PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_Table » Bug #2753

Filling table with values - order with setting table header

Details

Submitted2004-11-15 09:15 UTC
FromLukasz at Nowak dot eu dot org
StatusBogus
PackageHTML_Table
PHP Version4.3.9
OSLinux
Roadmaps(Not assigned)

Comments

[2004-11-15 09:15 UTC] Lukasz at Nowak dot eu dot org

Description:
------------
While filling table with content _before_ setting header, with manual rows numbering, first row is ovverriden by header.

If header is set before addRow() all is correct.

Reproduce code:
---------------
/* common */
$tdata = array('one','two','three');
$t = new HTML_Table();
$t->setAutoGrow(true);
/* eat first */
for ($i=0;$i<count($tdata);++$i)
$t->addRow($tdata[$i]);
$t->setHeaderContents(0, 0, nr");
/* won't eat */
$t->setHeaderContents(0, 0, nr");
for ($i=0;$i<count($tdata);++$i)
$t->addRow($tdata[$i]);
/* show */
print $t->toHTML();

Expected result:
----------------
I'd except that in this situation now data would be lost and setting headercontent won't affect already inserted data.

[2004-11-15 09:16 UTC] Lukasz at Nowak dot eu dot org

s/now data/no data/

[2004-11-23 12:19 UTC] Lukasz at Nowak dot eu dot org

I thought that setting table header should not be affected by where is set in code - before or after of table content. Yes, changing index to 1 fixes that problem. I belive that it should be noted in docs, because the data are silently overwritten and it takes me some time to find (made by me) problem.