问题
I have a table of class players
with 5 columns and 40 rows. I want to make the second column have width: 200px
.
I can not figure out how to select the specific column in the table. So far I have narrowed it down to this, but this does it to all of the rows in the table. Can someone help me set the column width for a specific column?
table.players td
{
}
回答1:
This should work (except on IE8 and below):
table.players td:nth-child(2) { width: 200px; }
来源:https://stackoverflow.com/questions/11287101/targeting-specific-column-in-table