generating multiple tables with Console_Table
| From: | culley harrelson | Date: | Sat, 29 Mar 2003 07:39:36 +0000 |
| Subject: | generating multiple tables with Console_Table | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-14718@lists.php.net to get a copy of this message | ||
I have been using console table to generate email-based reports and when
you try to display 2 tables back to back the static setting of $return in
_getSeparator() persists and screws up the width of the second tabe:
<?php
require_once("Console/Table.php");
$tbl =& new Console_Table();
$tbl->setHeaders(array('tbl 1 - col 1', 'tbl 1 - col 2', 'tbl 1 - col
3'));
$tbl->addRow(array('data 1', 'data 2', 'data 3'));
echo "Table 1\n";
echo $tbl->getTable();
echo "\n\n";
$tbl =& new Console_Table();
$tbl->setHeaders(array('tbl 2 - col 1', 'tbl 2 - col 2'));
$tbl->addRow(array('data 1', 'data 2'));
echo "Table 2\n";
echo $tbl->getTable();
echo "\n\n";
?>
The static setting is just so it doesn't have the calculate the value
repeatedly right?
culley