<?php
$row1 = "FFFFFF";
$row2 = "AAAAAA";
$counter = 0;
while ($rows = mysql_fetch_array($result))
{
$color = ($counter % 2 ==0) ? $row1 : $row2 ;
echo "<tr style='backgroundcolor:$color'><td>...";
}
bastien
ps: a class css definition would be better here
From: Jeff Grossman <[EMAIL PROTECTED]>
To: [email protected]
Subject: [PHP-DB] Table Output Question
Date: Mon, 14 Nov 2005 15:37:36 -0800
I have a table, where each line is the output of a query from a MySQL
database. I do not use borders, so the page is a little difficult to
read sometimes. Is it possible, or how do I, alternate the background
color of each row when I output it?
My code is like this:
while (query) {
<TR>
<TD></TD>
</TR>
}
I am not sure how to output two rows in the same while loop.
Thanks for any help you can offer me.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php