在css模板选项中找不到自动换行

时间:2017-03-16 05:24:35

标签: html css

我无法在CSS模板中找到自动换行。什么可能是没有自动换行的原因?我将如何解决这个问题?

1 个答案:

答案 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>