Ian Young wrote:
> Have site with alternating colours in dynamic website using php. Want to
> change the code to css.
> 
> code as follows:
> $bg = ($bg=='#eeeeee' ? '#F9FBF9' : '#eeeeee'); // Switch the background
> color.
> <tr bgcolor="$bg">
> 
> I know it is a table, but it for tabulating results. It is one of pages in
> Zen Cart which I am designing to my own design.
> 
> So how do I change the above to something more style friendly?

I'd do it something like this:

$rowClass = ($rowClass=='odd' ? 'even' : 'odd');
<tr class="$rowClass">

Untested, YMMV, etc.

Then you can alter the background colors in the stylesheet and make 
other changes as well if you decide you want them later.

So,

tr.odd {background-color: #eee}
tr.even {background-color: #F9FBF9]

-- 
Steve Clason
Boulder, Colorado, USA
(303) 818-8590
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7 information -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to