Thanks Rafael! I am just a bit disapointed that there is no provision in CSS for this pretty common ornament for tables (remember the paper with green stripes?).
I don't want to add a class because that's extra work for the server when the table is generated with JSP for example. The server has to keep track on the row parity, which to me is more presentation than server stuff. On top of that, we have an invasion of classes, divs, tables and Javascript that is totally overwhelming! It seemed to me pretty easy to add an "evenrow" and "oddrow" selector in CSS! Anyway, thanks for answering, it confirms what I thought, I was just hoping that there was a trick in CSS somehow! Fred --- Rafael Holt <[EMAIL PROTECTED]> wrote: > On 28/10/06, Fred Janon <[EMAIL PROTECTED]> wrote: > > > > How to get alternating row colors in a table or a list? > > > > I know of solutions with Javascript but I am looking for something > that > > would be done with CSS only, I don't want to have to have a class > for > > the even rows (or odd). Now that we have CSS 2.1, with "counter" > and > > "content", does anyone have an idea? > > > > Thanks > > > > Fred > > > Hi, > > CSS3 adds support for this using the nth-child selector, but there is > close > to no support for this so it is useless at the moment. Counter is not > supported well enough either, so it's not reliable to use yet. Short > of > adding a class (which is how people generally go about this) or using > javascript, there is not much else you can do. > > Why don't you want to add a class to the even/odd rows? > > Rafael > ______________________________________________________________________ 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/
