简体   繁体   English

表的薄黑边界

[英]Thin Black Border for a Table

在此输入图像描述

I need to have such thin line for the whole table as seen above. 如上所示,我需要为整个桌子设置这么细的线条。 The above image is a sample only. 以上图片仅为示例。 My solution, doesn't work. 我的解决方案,不起作用。 The table shows no border at all. 该表显示没有边框。

Here is my CSS: 这是我的CSS:

table {
    border-width: thin;
    border-spacing: 2px;
    border-style: none;
    border-color: black;
}

Style the td and th instead 另外调整tdth样式

td, th {
    border: 1px solid black;
}

And also to make it so there is no spacing between cells use: 而且为了使它在单元格之间没有间距使用:

table {
    border-collapse: collapse;
}

(also note, you have border-style: none; which should be border-style: solid; ) (另请注意,你有border-style: none;哪个应该是border-style: solid;

See an example here: http://jsfiddle.net/KbjNr/ 在这里查看示例: http//jsfiddle.net/KbjNr/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM