border-collapse: collapse 在tbody中无效果请教
<table class="fiex-head-table3">
<thead>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
</tbody>
</table>
<style lang="scss">
.fiex-head-table3 {
tr {
display: table; // 如果这行没有,border 可以合并,但是下面的 tbody中td的宽度又不是设定值了
width: 100%;
table-layout: fixed;
/*重要 表格固定算法*/
}
td {
border: 0.5px solid;
height: 26px;
box-sizing: border-box;
border-collapse: collapse; // 横向border 没有合并
text-overflow: ellipsis;
text-align: center;
}
thead>tr>td {
width:100px;
background-color: #ccc;
}
tbody {
display: block;
overflow-y: auto;
max-height: 520px;
td {
width:100px;
border-color: green;
}
}
}
</style>