Zebra Striping a Table with CSS 3

In one of the previous posts, we have already discussed on applying the Zebra strips effect using jQuery to a HTML table. We can do the same using CSS3 selectors.

Zebra Striping a Table with CSS3

Zebra Striping a Table with CSS3

To add Zebra strips to a table use the following CSS3 code snippet.

//Zebra striping a table with CSS3
tr:nth-child(even) {
  background-color: #ccc;
}

 

0 Comments

Leave a Comment.