javascript - Change Background color for a specific column in a HTML table -


I want to change the background color of a specific column in an HTML table. Is it possible to use the property to do this? I found a way to do it with rows.

  tr.even {background-color: white; }   

If you are looking for style in the background of the column, and any row No, you can try something like this (below). You have to change the selectors to match your HTML.

td: first-child {background-color: #ccc; }

Below is a link to Bella, as well as a way to add classes through JS. There are several ways, but since you are working with columns, remember that CSS is being applied in every line in the same style as the style you want.


Comments