-7

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?

enter image description here

hiamprolish
  • 49
  • 1
  • 6

1 Answers1

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}

Check here google 1st result

akash
  • 2,117
  • 4
  • 21
  • 32