我正在尝试在一个字符串被分成多行时添加margin-bottom
。
我了解了box-decoration-break
,但似乎不能实现我想要的效果。
下面的代码片段展示了我想要做的事情(只有最后一行应该有margin-bottom
)。
div {
max-width: 250px;
}
table {
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
}
td div {
margin-bottom: 25px;
}
<div>
<table>
<tr>
<td>One</td>
<td>1</td>
<td>
<div>This is a short string</div>
</td>
</tr>
<tr>
<td>Two</td>
<td>2</td>
<td>
<div>This is a short string</div>
</td>
</tr>
<tr>
<td>Three</td>
<td>3</td>
<td>
<div>This string is way too long so it will be broken</div>
</td>
</tr>
</table>
<div>