如何为表创建连续的边框线?

时间:2015-06-29 09:38:56

标签: html css

enter image description here

我正在使用html创建一个表。我想为不同的表行创建连续的行,而不是第一行的连接行。使用表的border-collapse属性可以帮助连接行,但是这也会加入标题行,在标题的单元格之间不留空格。如何在不影响最高线条的情况下将线条与蓝色圆圈连接起来? Here's the fiddle,html和css代码。

    <table id="table">
        <tr>
            <td>ENTERPRISE</td>
            <td>PRIMARY VARIABLES</td>
            <td>SECONDARY VARIABLES</td>
        </tr>
        <tr>
            <td>Labor Market</td>
            <td>N/A</td>
            <td>Both events had an excellent attendance from C-level executives, with the CFO Forum having its highest attendance rate so far.</td>
        </tr>
        <tr>
            <td>Economic Diversification</td>
            <td>recently hosted two of its flagship events in Hong Kong, the INED Forum and CBA Forum.</td>
            <td>For further information on previous INED and CFO events, please click here to access the Pursuits Resource Centre.</td>
        </tr>
        <tr>
            <td>Innovation and R&D</td>
            <td>He has vast experience working with insurance audit clients, and will be working on two global accounts.</td>
            <td>Sandy specialises in tax, and brings vast knowledge with her in terms of asset management and private equity</td>
        </tr>
    </table>

#table tr:first-of-type td{
    font-size: 18pt;
    color: rgb(0,37,122);
    background-color: rgb(152,198,234);
    text-align: center;
    font-family: "Arial Bold";
    height: 18px;
}
#table tr:not(:first-of-type){
    font-family: "Arial Regular";
    font-size: 14pt;
    color: rgb(51,51,51);
}
td{
    padding-top: 18px;/*2.3653%*/
    padding-bottom: 18px;
    padding-right: 57px; /*3.5625%*/
    border-style:none none solid none;
}
tr td:last-of-type{
    padding-right: 0;
}

5 个答案:

答案 0 :(得分:2)

#table {
    border-spacing:0
} 

是你的答案

答案 1 :(得分:0)

请将cellspacing添加到表格标签。

<table id="table" cellspacing="0">

演示http://jsfiddle.net/yvyonxhw/1/

答案 2 :(得分:0)

#table{
  border-spacing: 0; 
  border-collapse: separate; 
}

border-spacing css属性可以帮助您。

border-spacing属性设置相邻单元格边框之间的距离

附上工作fiddle

答案 3 :(得分:0)

从表中删除边框:

table {
    border-collapse: collapse;
}

您的fixed JSFiddle

请参阅here,了解为何使用border-collapse代替border-spacing

答案 4 :(得分:0)

加厚你的td边框直到它模糊了! (为我工作)

table td{
   border: 2px solid black;
}

然后根据需要使透明线变薄(1px)。

相关问题