如何设置表格边框小于单元格高度

时间:2015-12-27 08:09:08

标签: html css html5 html-table

我希望表格单元格之间的分隔边界将是它高度的一半

见预览图片:enter image description here

这是小提琴链接:

Fiddle link

#details_gdr {
    height: 50px;
    line-height: 25px !important;
    margin-top: 3px;
}

#details_gdr tbody tr:not(:last-child) {
    height: 25px;
    border-bottom: 1px solid #D0E0EA;
}

#details_gdr tbody tr th:not(:last-child) {
    border-right: 1px solid #D0E0EA;
}

#details_gdr tbody tr th {
    width: 28px;
    text-align: center !important;
}

2 个答案:

答案 0 :(得分:3)

这是你的解决方案。

#details_gdr {
    height: 50px;
    line-height: 25px !important;
    margin-top: 3px;
    border-collapse: collapse;
}

#details_gdr tbody tr:not(:last-child) {
    height: 25px;
    border-bottom: 1px solid #D0E0EA;
    font-size: 1.4em;
}

#details_gdr tbody tr:not(:last-child) th + th::before {
    color: #D0E0EA;
    content: '|';
    font-size: 0.6em;
    position: relative;
    top: -2px;
    left: -7px;
}

#details_gdr tbody tr th {
    width: 28px;
    text-align: center !important;
}

https://jsfiddle.net/p4ynsxt3/

答案 1 :(得分:-2)

你可以使用右侧的图像作为你的分隔符,如下面的css:

background:url(line.png) bottom right no-repeat;
相关问题