
表格边框
如需在 CSS 中设置表格边框,请使用 border 属性。 ( 推荐学习:CSS入门教程 )
下面的例子为 table、th 以及 td 设置了蓝色边框:
<html>
<head>
<style type="text/css">
table,th,td
{
border:1px solid blue;
}
</style>
</head>
<body>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
</tr>
<tr>
<td>Bill</td>
<td>Gates</td>
</tr>
<tr>
<td>Steven</td>
<td>Jobs</td>
</tr>
</table>
</body>
</html>请注意,上例中的表格具有双线条边框。这是由于 table、th 以及 td 元素都有独立的边框。
立即学习“前端免费学习笔记(深入)”;
如果需要把表格显示为单线条边框,请使用 border-collapse 属性。
以上就是CSS的表格边框使用什么属性设置的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号