RE: [PHP] Re: Making alternate rows of different colour
| From: | (Edward Peloke) | Date: | Fri, 17 Jan 2003 14:39:22 +0000 |
| Subject: | RE: [PHP] Re: Making alternate rows of different colour | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132004@lists.php.net to get a copy of this message | ||
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:pipa@rush.avalon.hr]
Sent: Friday, January 17, 2003 8:55 AM
To: php-general@lists.php.net
Subject: [PHP] Re: Making alternate rows of different colour
"Denis L. Menezes" <menezesd@singnet.com.sg> wrote in message
news:1042790468.3e27b84501e28@pike.singnet.com.sg...
> 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