定位表中的特定列 [英] Targeting specific column in table

查看:53
本文介绍了定位表中的特定列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类别为 players 的表,具有5列40行。我想让第二列的宽度为:200px

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 
{

}


推荐答案

这应该有效( IE8及以下版本):

This should work (except on IE8 and below):

table.players td:nth-child(2) { width: 200px; }

这篇关于定位表中的特定列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆