边界半径html表

时间:2013-11-17 20:55:25

标签: html css twitter-bootstrap css3

我一直试图将一些圆角应用到我的桌子上,但我似乎无法将其弄好。单击<thead>后,我的表格将被折叠。 <thead>只需要有圆角,而最后<tr>元素只需要有圆角。我正在使用bootstrap作为框架。

目前我的设计看起来像这样:

Current header

Current last element

我希望我的<head>看起来像这样:

enter image description here

而最后一个元素仍然有圆角。

table.html

<table align="center" class="table table-curved" id="nextTeamTable">
    <thead data-parent="#bodyContainer" data-toggle="collapse" data-target="#tbodyCollapse">
        <tr>
            <th>HeadTitle</th>
        </tr>
    </thead>
    <tbody class="collapse" id="tbodyCollapse">
        <tr>
            <td>Body1</td>
            <td>Body2</td>
            <td>Body3</td>
        </tr>
    </tbody>
</table>

table.css

.table-curved {
    border-collapse:separate;
    border: solid #ccc 1px;
    border-radius: 25px;
}

.table-curved tr:last-child td
{
    border-bottom-left-radius: 25px;    
    border-bottom-right-radius: 25px;   
}

1 个答案:

答案 0 :(得分:43)

编辑 - 尝试此操作:将overflow:hidden放在.tabled-curvedborder-radius: 25px;。然后只需删除border-radius CSS的其余部分