If you only want to color the second column, you can use something similar to:
td:nth-child(2) { background: #CCC }
DEMO - change the color of the second column
If you also want to include the header, you can add it to th , similarly:
th:nth-child(2) { background: teal }
DEMO - change the header color of the second column
If you want to color every second column, not just the second column, you can use an odd and even similar one:
th:nth-child(even) { background: teal; } td:nth-child(even) { background: #CCC; }
DEMO - apply colors to every second column
source share