如何制作这样一个在单元格之间有虚线的表格,尽可能跨浏览器和自适应(没有 flex、grid、svg)?
我这样做了,但虚线没有到达末尾:
table {
width: 100%;
white-space: nowrap;
}
table td {
width:100%;
}
table td+td {
text-align: right;
width: auto;
}
.table-label {
overflow: hidden;
}
.table-label>span {
display: inline-block;
vertical-align: middle;
position: relative;
}
.table-label>span:after {
content: '';
position: absolute;
bottom: 5px;
right: -9999px;
left: 100%;
color: #cecece;
margin-left: 5px;
border-bottom: 1px dashed #cecece;
}
<table>
<tr>
<td>
<div class="table-label">
<span>
Lorem ipsum.
</span>
</div>
</td>
<td>
<span>
111
</span>
</td>
</tr>
<tr>
<td>
<div class="table-label">
<span>
Lorem.
</span>
</div>
</td>
<td>
<span>
2222222222
</span>
</td>
</tr>
<tr>
<td>
<div class="table-label">
<span>
Lorem ipsum dolor.
</span>
</div>
</td>
<td>
<span>
33
</span>
</td>
</tr>
</table>
你需要一张桌子吗?我可以提供一个项目符号列表。
更短的代码