Clark, Martin (M.) wrote:
> Ian,
>
> Not sure what's already been suggested, but I have this, which is
> working
>
> <tr>... </tr>
> <tr class="alternate"> ... </tr>
>
> td {background-color: #FFF; }
> tr.alternate td {background-color: #eee;}
>   

The above CSS, or something similar, is the only way to accomplish this 
with pure CSS. For the record, CSS can't just magically know to make 
alternate rows different colors because it's based on ancestors and 
descendants to select elements, and one table row is the same as another 
table row. They're both descendants of a tbody or table, so there's no 
way to distinguish one from another, except as siblings, but that would 
involve too many crazy sibling selectors. Just pointing out the logic 
behind CSS's inability to handle this task best left to programming in 
case anyone decides to malign my precious CSS2 for it. ;-) As Martin 
Heiden pointed out, CSS3 will be able to handle this, though.

Martin Clark, note how I cut out all of the previous message that wasn't 
relevant to my reply. This is called trimming, and its a requirement of 
posting on this list. Please be sure to do this with your future 
messages. We'd also appreciate it if you bottom-posted, as I'm doing, 
but this isn't a requirement.

Thanks,
Zoe

-- 
Zoe M. Gillenwater
Design Services Manager
UNC Highway Safety Research Center
http://www.hsrc.unc.edu

______________________________________________________________________
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