Using css only, how can I override the css of only the 2nd column of a table.
I can get to all of the columns using:
.countTable table table td
I can not get to the html on this page to modify it since it is not my site.
Thanks.
Using css only, how can I override the css of only the 2nd column of a table.
I can get to all of the columns using:
.countTable table table td
I can not get to the html on this page to modify it since it is not my site.
Thanks.
You can use the :nth-child
pseudo class like this:
.countTable table table td:nth-child(2)
Note though, this won't work in older browsers (or IE), you'll need to give the cells a class or use javascript in that case.
You could designate a class for each cell in the second column.
<table>
<tr><td>Column 1</td><td class="col2">Col 2</td></tr>
<tr><td>Column 1</td><td class="col2">Col 2</td></tr>
<tr><td>Column 1</td><td class="col2">Col 2</td></tr>
<tr><td>Column 1</td><td class="col2">Col 2</td></tr>
</table>