Re: Alternate row color

From: Date: Wed, 09 Aug 2000 06:58:25 +0000
Subject: Re: Alternate row color
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-10846@lists.php.net to get a copy of this message
Thanks everybody, I slapped together a small bit of code that works. Thanks for your contributions!!!! -- Tyler Longren [Web Development] Premier Visual Services http://www.pvs2000.com ----- Original Message ----- From: "Peter Bowen" <pzb@datastacks.com> To: <tyler.longren@midiowa.net> Cc: "PHP-General" <php-general@lists.php.net> Sent: Tuesday, August 08, 2000 9:32 PM Subject: Re: [PHP] Alternate row color > Tyler, > > Try the following code. It should alternate between white and gray > background > colors. > > if ($rownum%2) > $color = "#ffffff"; > else > $color = "#777777"; > print("<TD BGCOLOR=$color>"); > > I hope that this helps. > > Thanks. > Peter > > > Hello, > > > > How could I alternate table row colors by using a for or while loop? It > > can't be that hard. I just can't grasp it. I will be gettting the rows > > out of a MySQL db, and I want to alternate the colors on a page. Any > > examples? > > > > Regards, > > -- > > Tyler Longren > > [Web Development] > > Premier Visual Services > > http://www.pvs2000.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > >

« previous php.general (#10846) next »