0
我想使用带边框的引导程序3表格,例如使用class="table table-bordered"
,这样我会在单元格之间有边框,但是我不希望表格外部有任何边框。bootstrap3表格边界没有外部边界
我尝试了以下方法,并且它似乎适用于两侧,但考虑到thead
和tfoot
是可选元素,我无法想出一个处理潜在顶部和底部边界的好方法。我希望能够做出强有力的事情来解决这些情况,最大限度地发挥潜力。
.table-bordered.no-outside-borders {
border: none;
}
.table-bordered.no-outside-borders>thead>tr>td:first-child,
.table-bordered.no-outside-borders>thead>tr>th:first-child,
.table-bordered.no-outside-borders>tfoot>tr>td:first-child,
.table-bordered.no-outside-borders>tfoot>tr>td:first-child,
.table-bordered.no-outside-borders>tbody>tr>td:first-child,
.table-bordered.no-outside-borders>tbody>tr>th:first-child {
border-left: none;
}
.table-bordered.no-outside-borders>thead>tr>td:last-child,
.table-bordered.no-outside-borders>thead>tr>th:last-child,
.table-bordered.no-outside-borders>tfoot>tr>td:last-child,
.table-bordered.no-outside-borders>tfoot>tr>th:last-child,
.table-bordered.no-outside-borders>tbody>tr>td:last-child,
.table-bordered.no-outside-borders>tbody>tr>th:last-child {
border-right: none;
}
在这里有一个很好的CSS解决方案吗?