Table: Alternate Colors

You can easily add more styling to your table, with just a simple line (or two) to the CSS style sheet:

Color the background of every even (2nd, 4th, 6th, etc) row:
table#t01 tr:nth-child(even) {
    background-color: red; }

If the first row is a <th> row, it isn't affected by <tr> styling. You can color the background of every odd (1st, 3rd, 5th, etc) row:

table#t01 tr:nth-child(odd) {
    background-color: pink; }

Make the <th> heading row all black with white text:

table#t01 th {
    color: white;
    background-color: black; }
Colorful Table
Back button Table of Contents Next button