常见的做法是利用 CSS2 的 "border-collapse:collapse;" 属性合并表格边框;并对 table 元素设置左边框和上边框,对 th 和 td 元素设置右边框和下边框。
Markup:
复制代码代码如下:
<table>
<tr>
<th>table head (row1, col1)</th>
<th>table head (row1, col2)</th>
<th>table head (row1, col3)</th>
</tr>
<tr>
<td>table data (row1, col1)</td>
<td>table data (row1, col2)</td>
<td>table data (row1, col3)</td>
</tr>
<tr>
<td>table data (row2, col1)</td>
<td>table data (row2, col2)</td>
<td>table data (row2, col3)</td>
</tr>
</table>
CSS:
复制代码代码如下:
table{border-collapse:collapse;border-spacing:0;border-left:1px solid #888;border-top:1px solid #888;background:#efefef;}
th,td{border-right:1px solid #888;border-bottom:1px solid #888;padding:5px 15px;}
th{font-weight:bold;background:#ccc;}
Markup:
复制代码代码如下:
<table>
<tr>
<th>table head (row1, col1)</th>
<th>table head (row1, col2)</th>
<th>table head (row1, col3)</th>
</tr>
<tr>
<td>table data (row1, col1)</td>
<td>table data (row1, col2)</td>
<td>table data (row1, col3)</td>
</tr>
<tr>
<td>table data (row2, col1)</td>
<td>table data (row2, col2)</td>
<td>table data (row2, col3)</td>
</tr>
</table>
CSS:
复制代码代码如下:
table{border-collapse:collapse;border-spacing:0;border-left:1px solid #888;border-top:1px solid #888;background:#efefef;}
th,td{border-right:1px solid #888;border-bottom:1px solid #888;padding:5px 15px;}
th{font-weight:bold;background:#ccc;}
标签:
网页细线,表格设计
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com
暂无“兼容浏览器的css网页细线表格设计”评论...