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

-nathan

On 10/3/07, Jon Anderson <[EMAIL PROTECTED]> 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
>
>

Reply via email to