Using CSS3 for Alternate Row Colors

Using CSS3 for Alternate Row Colors

The DIV movement of getting away from table-based design taught us that tables should be used only when you're presenting a table of data on your website, yet no CSS selector/rule was created to allow us to shade alternate rows a different color.

tr:nth-child(odd)   { background-color:#eee; }
tr:nth-child(even) { background-color:#fff; }
Tag: