Home » HTML » HTML_Table » Bug #5787
Tables created with only addCols don't render
Details
| Submitted | 2005-10-26 13:18 UTC |
|---|---|
| From | leonard-php-bugzilla at ottolander dot nl |
| Assigned | wiesemann |
| Status | Bogus |
| Package | HTML_Table |
| PHP Version | 4.3.9 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-10-26 13:18 UTC] leonard-php-bugzilla at ottolander dot nl
Description:
------------
Testing on CentOS-3 (php-4.3.2) and CentOS-4 (php-4.3.9).
Updated HTML_Table from 1.5 to 1.6.0. Now tables created with only addCols do not get rendered. Reverting to 1.5 fixes the issue.
Test script:
---------------
<?php
require_once "HTML/Table.php";
$tableAttrs = array();
$table = new HTML_Table($tableAttrs);
unset($contents);
$contents[0] = '1';
$contents[1] = '2';
$table->addRow($contents, $attributes, "TD");
unset($contents);
$contents[0] = '3';
$contents[1] = '4';
$table->addRow($contents, $attributes, "TD");
echo $table->toHtml();
$table2 = new HTML_Table($tableAttrs);
unset($contents);
$contents[0] = '1';
$contents[1] = '2';
$table2->addCol($contents, $attributes, "TD");
unset($contents);
$contents[0] = '3';
$contents[1] = '4';
$table2->addCol($contents, $attributes, "TD");
echo $table2->toHtml();
?>
Expected result:
----------------
Both tables get rendered. This happens for 1.5, but 1.6.0 fails to render the second one.
1.5:
1 2
3 4
1 3
2 4
1.6.0:
1 2
3 4
[2005-10-26 14:17 UTC] leonard-php-bugzilla at ottolander dot nl
#5871 is indeed the same issue. ($rows in addCol is not set.)
When looking for existing bugs for HTML_Table I went to http://pear.php.net/package/HTML_Table and clicked "bugs". I should of course have continued by clicking on "Status: All". Sorry for that. I'll be more thorough next time.