在这里,您现在就可以有&有一个愉快的一年!
你需要优化CSS的边界,填充和颜色与cellpadding和默认的东西的表格。规范网站中的所有表:
table {
width: 100%;
border-collapse: collapse;
border-bottom:1px solid #e1e1e1;
border-top:1px solid #e1e1e1;
margin-bottom: 10px;
background-color: #FFF;
}
table td {
padding: 4px 10px;
border-right:1px solid #e1e1e1;
border-left:1px solid #e1e1e1;
}
table th {
padding: 4px;
text-align: left;
border-right:1px solid #e1e1e1;
border-left:1px solid #e1e1e1;
font-weight: normal;
}
table tr {
border-left:1px solid #e1e1e1;
border-top:1px solid #e1e1e1;
}
并没有共同的样式表只是类添加到表标签(exapmle1):
table.example1 {
width: 100%;
border-collapse: collapse;
border-bottom:0px solid #e1e1e1;
border-top:0px solid #e1e1e1;
margin-bottom: 20px;
padding-bottom: 20px;
background-color: #FFF;
}
table.example1 td {
padding: 0px 0px;
border-right:0px solid #e1e1e1;
border-left:0px solid #e1e1e1;
}
table.exapmle1 th {
padding: 0px;
text-align: left;
border-right:0px solid #e1e1e1;
border-left:0px solid #e1e1e1;
font-weight: normal;
}
table.example1 tr {
border-left:0px solid #e1e1e1;
border-top:0px solid #e1e1e1;
}
您也可以自定义很多事情更多的类...
并将类添加到td标记为例。
希望这会有所帮助。
您不能将任何HTML属性“转换”为CSS。要使某些表适用于某些表,而不适用于其他表,请使用类名。 – 2012-01-01 09:05:16