Home » HTML » HTML_Table » Bug #7971
setTab() does not work
Details
| Submitted | 2006-06-23 11:38 UTC |
|---|---|
| From | kristoffer dot paro at gmail dot com |
| Assigned | wiesemann |
| Status | Closed |
| Package | HTML_Table |
| PHP Version | 5.1.4 |
| OS | Debian 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>