At 1:44 PM -0500 10/3/07, Steve Marquez wrote:
Greetings,

I am attempting to alternate the colors of the container DIV. Anyone know
how to do this?

Hi Steve:

Easy and simple.

First, keep presentation separate from data. In other words, use css to define a css-class, like so:

.row0
        {
        background-color: yellow;
        }

.row1
        {
        background-color: #809FFF;
        }


Second, embed php into your table, like so:

        <tr class="row<?php echo($i++ & 1 );?>">

You can see a working demo here:

http://webbytedd.com/b/color-rows/

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to