Targeting specific column in table

こ雲淡風輕ζ 提交于 2020-06-24 12:07:31

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!