Re: Alternate Colors in Rows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thats the key use mod 2 and check if the result is 1 or 0.

-nathan

On 10/3/07, Jon Anderson <jon@xxxxxxxxxxxxxxxxxx> wrote:
>
> Steve Marquez wrote:
> > I am attempting to alternate the colors of the container DIV. Anyone
> know
> > how to do this?
>
> I've used variants of this:
>
> <?php while ($condition): ?>
>     <div style="background-color: #<?= ($i++%2) ? 'ffffff' : 'eeeeee'
> ?>;">
> <?php endwhile ?>
>
> jon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux