也许有一个表格,但我需要中心列来用边框底部(或其他东西)填充空白
这是一个codepen
<table class="table">
<tbody>
<tr>
<td>
<h5>Index 1</h5></td>
<td>
<span class="line"> </span>
</td>
<td>
Content
</td>
</tr>
<tr>
<td>
<h5>Index 2</h5></td>
<td>
<span class="line"></span>
</td>
<td>
Content
</td>
</tr>
</tbody>
</table>
最佳答案
试试这个
<table class="table">
<tbody>
<tr>
<td class="Index">
<h5>Index 1</h5>
</td>
<td>
Content
</td>
</tr>
<tr>
<td class="Index">
<h5>Index 11</h5>
</td>
<td>
Content
</td>
</tr>
</tbody>
</table>
<----CSS----->
table {
width: 50%;
border-collapse: collapse;
white-space: nowrap;
}
table h5 {
margin: 0;
display:inline-block;
}
td,
tr,
table {
padding: 0;
overflow:hidden
}
.Index::after{
content:"";
width:100%;
display:inline-block;
background-color:#000;
height:1px;}
关于html - HTML 和 CSS 中带有底线的图书索引布局样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40485700/