I did this by defining two colors, and as I looped through the query, I would just change it each time...
ex... $trcolor="#F0F8FF"; while ($myrow = mysql_fetch_array($result)){ $colorset=0; if ($trcolor=='#F0F8FF'){ $trcolor='#B0C4DE'; $colorset=1; } if ($colorset==0){ if ($trcolor=='#B0C4DE'){ $trcolor='#F0F8FF';} } print "<tr bgcolor='$trcolor'>"; } Eddie -----Original Message----- From: rush [mailto:[EMAIL PROTECTED]] Sent: Friday, January 17, 2003 8:55 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Making alternate rows of different colour "Denis L. Menezes" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I put the output of the database query in a table. It works fine. Now I have a need to make the alternate rows of a different color. > > Can someone please help me with the code? See one possible solution (with TemplateTamer) : http://www.templatetamer.org/index.php?AlternatingListExample rush -- http://www.templatetamer.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php