html_tables question - Please Help Me!!!
| From: | leegold | Date: | Sun, 31 Oct 2004 13:59:34 +0000 |
| Subject: | html_tables question - Please Help Me!!! | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15244@lists.php.net to get a copy of this message | ||
Will anyone please help???
-------- Original Message --------
Subject: [PEAR] html_tables question
Date: Sat, 30 Oct 2004 22:34:47 -0400
From: leegold <leegold2@verizon.net>
To: pear-general@lists.php.net
References: <54748422-2AC7-11D9-B705-000A95C91262@erikheerlein.com>
I want a table structure of one cell per row with each row having
alternating color, so basically I'll end up - if say I have multiple
rows - with rows of single "boxes" with content inside. It's not exactly
tabular but it's what I need right now. But I'm having trouble, it
renders with two (2) cells per row no matter what I try, one cell with
my content an another skinny one with "N/A". How can I get rid of the
extra skinny cell? Thanks.
require_once "HTML/Table.php"; // trying the table class
$table = new HTML_Table("table border=0 cellpadding=10 cellspacing=5");
// $table -> setAutoGrow(true);
// $table -> setAutoFill("n/a");
// $table -> setHeaderContents(0, 0, "Title");
// $table -> setHeaderContents(0, 1, "URL");
// $table -> setHeaderContents(0, 2, "Description");
$hrAttrs = array("bgcolor" => "#D9D9F3");
$table -> setRowAttributes(0, $hrAttrs, true);
....snip....
$table -> addRow(array($t_content.'<p>'.$url_col.'<p>'.$d_content));
$table->setColAttributes(0, array('class' => 'nameCol')); // do i need this?
$altRow1 = array("bgcolor"=>"#E0FFFF");
$altRow2 = array("bgcolor"=>"#DAF4F0");
$table -> altRowAttributes(1, $altRow1, $altRow2);
echo $table->toHTML();
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php