2ppzbw
Last Updated: March 08, 2016
·
2.034K
· andreia
Mesr

Zebra table using only CSS3

tr:nth-child(2n+1){ background: ‪#fff‬ } 
tr:nth-child(2n+0){ background: ‪#ffffec‬ }
Say Thanks
Respond

4 Responses
Add your response

1808
F8ec7f90daf8b1defb8e318d663c0f17

I believe you can also use :nth-chilld(even) and :nth-child(odd). :)

over 1 year ago ·
4207
87f227b9aa2967224be3dde79eb0163d

You don't need two nth-child selectors, just give the default style to the original tr element. If you want to do every other row starting with the second, 2n or even is sufficient.

over 1 year ago ·
5740

This doesn't work.

over 1 year ago ·
5741

This doesn't work.

over 1 year ago ·