Home > Web Front-end > HTML Tutorial > 定义表格第一列_html/css_WEB-ITnose

定义表格第一列_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:46:56
Original
1004 people have browsed it


下边是我表格第一列的格式,这样我必须在每行第一个表格加一个 class="left"

在css里边可以直接定义表格第一列吗?



table.addedit  .left{    padding-right:10px;    width:60px;    text-align:right;    vertical-align:top; }  
Copy after login
Copy after login




回复讨论(解决方案)

定义第一列示例:
td:first-child { background-color : green}

参考:http://www.w3.org/Style/CSS/Test/CSS3/Selectors/current/html/full/flat/css3-modsel-32.html


1楼的方法可行

定义第一列示例:
td:first-child { background-color : green}

下边是我表格第一列的格式,这样我必须在每行第一个表格加一个 class="left"

在css里边可以直接定义表格第一列吗?



table.addedit  .left{    padding-right:10px;    width:60px;    text-align:right;    vertical-align:top; }  
Copy after login
Copy after login


非常感谢


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template