| Laurent Laville 2005-05-08, 8:56 pm |
| Hi all,
On my current project i've used recently the HTML_Table package to
generate an html table. All run fine until a play more with it !
I've tried a clone of pear manual and dicovered a problem when data cell
is equal to zero (integer). The zero was replaced by null string.
BTW: there is a typo error in pear manual example at
http://pear.php.net/manual/en/packa...table.intro.php
$table -> setHeaderContents(0, 1, "EMail");
should be written like that
$table -> setHeaderContents(0, 4, "EMail");
Have a look at URL: http://pear.laurent-laville.org/HTML_Table/
You'll see the visual result
To solve the bug, but i'm not sure it's the best solution could be to :
patch HTML_Table::toHtml() method around line 583 as
if (isset($this->_structure[$i][$j]["contents"])) {
if (is_int($this->_structure[$i][$j]["contents"])) {
$contents = strval($this->_structure[$i][$j]["contents"]);
} else {
$contents = $this->_structure[$i][$j]["contents"];
}
} else {
$contents = "";
}
Tell me what you think about it
regards
Laurent Laville
|