我无法在CSS模板中找到自动换行。什么可能是没有自动换行的原因?我将如何解决这个问题?
答案 0 :(得分:0)
您可以在word-wrap
元素上使用td
。我猜测您正在使用等待您键入选项的软件,然后让您从选项中进行选择。
您可以在下方看到工作示例,或参阅this answer了解详情。以下重要部分是table-layout: fixed
以及word-wrap
元素上的td
。
td {
border: 1px solid;
}
<table style="table-layout: fixed; width: 100%">
<tr>
<td style="word-wrap: break-word">
LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongWord
</td>
<td style="word-wrap: break-word">
LongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongWord
</td>
</tr>
</table>