Wed, 2020-01-15 22:38
Hello, if I have send this before please forgive as I could not find this question in the forum. My question is this. For the table I placed onto the webpage the header styling seems to effect one of the columns as well. If I change the th styling background color the column also changes. All the other rows/columns are as I have set them. Now, I would not even know how to change the color of a single column. Can somebody help please?
Thanks heaps!
Fri, 2020-04-10 16:36
#1
Changing the background of one column
This is how to change the background of the second column :
table td:nth-child(2) {background:red;}
Here's how to alternate two colors on the columns
table td:nth-child(even) {background:red;} table td:nth-child(odd) {background:yellow;}
More exemples with :nth-child()