【发布时间】:2015-09-11 11:22:40
【问题描述】:
我正在尝试设置表格的样式,但没有显示边框。我以前从来没有遇到过这种情况,所以我不知道该怎么办。
这是我的桌子:
<table class="table">
<thead>
<tr>
<th>Dessert (100g serving)</th>
<th>Calories</th>
</tr>
</thead>
<tbody>
<tr>
<td>Dessert (100g serving)</td>
<td>Calories</td>
</tr>
</tbody>
</table>
这是我的更少:
@dark-text: rgba(0,0,0,0.87);
@dark-text-secondary: rgba(0,0,0,0.54);
@dark-text-disabled: rgba(0,0,0,0.26);
.table {
z-index: 10;
thead {
tr {
border-bottom: 3px solid @dark-text-disabled;
z-index: 10;
th {
color: @dark-text-secondary;
z-index: 10;
}
}
}
tbody {
tr {
border-bottom: 3px solid @dark-text-disabled;
z-index: 10;
td {
z-index: 10;
}
}
}
}
【问题讨论】:
-
我相信你应该设置
td而不是tr,然后border-collapse: collapse来消除行之间的间隙。 -
@Huey 如果我在 Chrome 中使用 Inspect Element,我可以看到边框的高亮显示,但否则我看不到它。