table中cellspacing="0" cellpadding="0" css写法
table 的 cellpadding="0" cellspacing="0" 属性在CSS中定义的方法
border-collapse: collapse; 这一句将边框间距取消了。
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>35ui.cn</title>
<style type="text/css">
.box{border:1px solid #457FB9; border-collapse:separate; border-spacing:0;}
.floor { width:100%; background:#CCCCCC; border-collapse:collapse; border-spacing:1px; font-family:SimSun }
.floor td{ background:#FFF; height:24px;}
</style>
</head>
<body>
<div class="box">
<table class="floor">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</body>
</html>
“border-collapse:separate; ” 就是将表格边框分离开的意思,相当于cellspacing 属性,而cellpadding属性当然用padding代替了。而“border-collapse:separate; ”在IE6上不支持,FireFox上表现很好,看来在CSS支持方面还是Firefox比较标准啊!
原文地址:http://www.35ui.cn/post/20110816654.html 标签:北京网站制作做网页北京网页制作css网页制作