Posted By

logic_unit on 11/02/10


Tagged

css


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

logic_unit
pytheas
ratz2


CSS Alternate Table Row Background Colour


 / Published in: CSS
 

You can change the tr to p, span, or any class or tag for the same effect. Works nice on tables.

  1. .yourclass tr:nth-child(even) {
  2. background: #eee;
  3. }
  4.  
  5. .yourclass tr:nth-child(odd) {
  6. background: #333;
  7. }

Report this snippet  

You need to login to post a comment.