Odd Even Table in CSS

Even and odd table rows improve the readability of large tables. By using CSS you can easily color alternating rows. For instance, the following table has been given a pale blue background for the even rows and dark blue for the odd ones.



 tr:nth-child(odd) {background: #150095} /* selects every odd row */
 tr:nth-child(even) {background: #a293ff} /* selects every even row */

You can also create Odd and Even Rows for lists and other elements.


Leave a Comment.