我爲Bootstrap表添加了一個table-curved
類來圓角。我的表類如何擁有頂部邊框?
.table-curved {
border-collapse: separate;
}
.table-curved {
border: solid #ccc 1px;
border-radius: 2px;
border-left:0px;
}
.table-curved td, .table-curved th {
border-left: 1px solid #ccc;
border-top: 1px solid #ccc;
}
.table-curved th {
border-top: none;
}
.table-curved th:first-child {
border-radius: 2px 0 0 0;
}
.table-curved th:last-child {
border-radius: 0 2px 0 0;
}
.table-curved th:only-child{
border-radius: 2px 2px 0 0;
}
.table-curved tr:last-child td:first-child {
border-radius: 0 0 0 2px;
}
.table-curved tr:last-child td:last-child {
border-radius: 0 0 2px 0;
}
<table class="table table-curved " id="details">
</table>
但由於某種原因,當我應用此功能時,頂部會有一個較粗的邊框。爲什麼?
通常檢查元素會告訴你這裏的款式是來自。 –
'border-collapse:separate;'使邊框單獨顯示。您可以使用'border-collapse:collapse;'或通過'border-top:0'覆蓋'.table-curved'元素的頂部邊界。 ** [DEMO HERE](http://jsbin.com/dipej/1/edit)** –
@HashemQolami左上邊框爲0px。請看一下。 – TIMEX