Grow your CSS skills. Land your dream job.

How to change rows color in tables

  • # February 2, 2013 at 10:53 am

    Hello!

    Is there any way to use 2 different color for tables rows:

    row1: color1
    row2:color2
    row3:color1
    row4:color2
    and …

    notice that I want to do this without adding any classes to rows for color1 or 2.

    # February 2, 2013 at 11:21 am

    tr:nth-child(even) or (odd) or (2n)

    # February 2, 2013 at 12:09 pm

    Here: http://codepen.io/srig99/pen/BukHa.

    # February 2, 2013 at 12:27 pm

    Thanks you very much.

    It really works very well!!!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".