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 #7971

setTab() does not work

Details

Submitted2006-06-23 11:38 UTC
Fromkristoffer dot paro at gmail dot com
Assignedwiesemann
StatusClosed
PackageHTML_Table
PHP Version5.1.4
OSDebian GNU/Linux
Roadmaps(Not assigned)

Comments

[2006-06-23 11:38 UTC] kristoffer dot paro at gmail dot com

Description:
------------
The function setTab() does not work properly for html outputted by HTML_Table. This is because a setTab request does not descend into the _tbody, _thead and _tfoot objects. Therefore anything outputted by an object of the HTML_Table_Storage class will use the default tab (the \t character).

Suggested solution:
HTML_Table should override the setTab() function and call setTab on _tbody, _thead and _tfoot.

Test script:
---------------
$t = new HTML_Table();
//Set tab to a double space
$t->setTab(" ");
$t->addRow(array('a', 'b', 'c'));
echo $t->toHtml();

Expected result:
----------------
Double spaced table:

<table>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
</table>

Actual result:
--------------
Table is spaced by \t characters

<table>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
</table>