就像在主题上。我希望强制断线文本如下:
entercode&hereentercode&hereentercode&hereentercode&here并自动防止列表的宽度被长不可断的文本更改。
发布于 2022-10-01 15:54:25
将CSS规则white-space:normal;和word-break:break-all;添加到文本的包含元素中。
发布于 2022-10-01 16:05:42
您需要在td标记中添加单词包装:断开字;。
.wrap-text{
word-wrap: break-word;
max-width: 200px;
}<table>
<tr>
<th>No</th>
<th>Text</th>
</tr>
<tr>
<td>1</td>
<td class="wrap-text">entercode&hereentercode&hereentercode&hereentercode&here</td>
</tr>
</table>
https://stackoverflow.com/questions/73919745
复制相似问题