How to use rowspan in HTML_Table
| From: | Steven Nien | Date: | Sat, 24 May 2003 15:29:23 +0000 |
| Subject: | How to use rowspan in HTML_Table | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5585@lists.php.net to get a copy of this message | ||
Hi,
I have try to use HTML_Table. But I get a error result. I have
the php code:
<?php
require_once "HTML/Table.php";
$table =new HTML_Table(array('border'=>'1'));
$table->addRow(array('a1','a2'),
array(array('colspan'=>'2'),array('colspan'=>'2')));
$table->addRow(array('b1','b2','b3','b4'));
echo $table->toHTML();
?>
The result is: (HTML Source)
<table border="1">
<tr>
<td colspan="2">a1</td>
<!-- span -->
<td> </td>
<td> </td>
</tr>
<tr>
<td>b1</td>
<td>b2</td>
<td>b3</td>
<td>b4</td>
</tr>
</table>
The 'a2' is not in row 1. Why? Anyone can give me a hint.
PS: I use HTML_Table v1.5.
Thanks.
--
Steven Nien