Html 没有垂直单元格边框的表格
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11237204/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
TABLE with no vertical cell borders
提问by user1175551
I would like my HTML table to only show the horizontal cell borders. Is there a way where I can hide the vertical cell borders?
我希望我的 HTML 表格只显示水平单元格边框。有没有办法可以隐藏垂直单元格边框?
回答by JSW189
You can add strictly horizontal border lines by styling tr
tags via CSS.
您可以tr
通过 CSS样式化标签来添加严格的水平边框线。
Example CSS:
示例 CSS:
tr {
border-bottom: 1px solid black;
border-top: 1px solid black;
border-collapse: collapse;
}?
Of course, you can use any border style/width/color you choose.
当然,您可以使用您选择的任何边框样式/宽度/颜色。
JS Fiddle: http://jsfiddle.net/XPyzM/
JS小提琴:http: //jsfiddle.net/XPyzM/
回答by Niet the Dark Absol
Assuming you are using old-style <table border="1">
, make it <table border="1" rules="rows">
.
假设你使用的是 old-style <table border="1">
, make it <table border="1" rules="rows">
。
回答by Jukka K. Korpela
table, th, td {
border-left: none;
border-right: none;
}
回答by john ktejik
<style>
td {border-left: 1px solid black;}
</style>
回答by Deatk
th, td {
border-bottom: 1px solid #ddd;
}
回答by Naidu
You can add strictly horizontal border lines by styling tr tags via CSS.
您可以通过 CSS 设置 tr 标签样式来添加严格的水平边框线。
<TABLE
BORDER=1 CELLPADDING=3 CELLSPACING=1
RULES=COLS FRAME=BOX
>