I need to color every second row in my table. I would love it to look like on the attached image Any ideas how to do this?
Asked
Active
Viewed 9,699 times
1 Answers
5
EVEN AND ODD RULES
One way to improve the readability of large tables is to color alternating rows. For example, the table below has a light gray background for the even rows and white for the odd ones. The rules for that are extremely simple:
Css:
tr:nth-child(even) {background: #CCC}
tr:nth-child(odd) {background: #FFF}

akash
- 2,117
- 4
- 21
- 32