使用CSS如何只改变表的第二列 [英] Using CSS how to change only the 2nd column of a table

查看:1868
本文介绍了使用CSS如何只改变表的第二列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅使用css,我如何覆盖表的第二列的CSS。

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

我无法访问此页面上的html来修改它,因为它不是我的网站。

I can not get to the html on this page to modify it since it is not my site.

感谢。

推荐答案

code>:nth-​​child 这样的伪类:

You can use the :nth-child pseudo class like this:

.countTable table table td:nth-child(2)

请注意,这不会在旧版本的浏览器),你需要给单元格一个类或在这种情况下使用javascript。

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.

这篇关于使用CSS如何只改变表的第二列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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