On Mon, Sep 05, 2005 at 10:41:34AM -0600, JJ wrote: > I'm trying to setup styles for a simple table that will allow me to > easily alternate row colors. For simplicity in programming the page > generation, I'd ideally like to apply the style to the <tr> tags rather > than the <td> tags, but I'm not sure how to designate that in the css. > Is this possible?
I suspect what you'll want to do is set up an 'oddrows' class and an 'evenrows' class, a la .oddrows { background-color: blue; } .evenrows { background-color: white; } then give the table a unique ID, a la <table id="alternatingrows"> ... </table> then write a little Javascript to 1) find the unique element with the ID "alternatingrows". 2) iterate over the rows in that element, alternately labeling them 'even' or 'odd'. Alistapart.com tackled this a while ago with Zebra Tables: http://www.alistapart.com/articles/zebratables/ See if that does what you want. -- Stephen R. Laniel [EMAIL PROTECTED] +(617) 308-5571 http://laniels.org/ PGP key: http://laniels.org/slaniel.key
signature.asc
Description: Digital signature
______________________________________________________________________ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/