HTML表中的单词包装
我一直在用word-wrap: break-word将文本包装在divS和span然而,它似乎在表单元格中不起作用。我有一张桌子width:100%,有一行和两列。列中的文本,尽管采用上述样式word-wrap不包。它会导致文本超出单元格的界限。这种情况发生在Firefox、GoogleChrome和InternetExplorer上。
来源如下:
td {
border: 1px solid;
}
<table style="width: 100%;">
<tr>
<td>
<div style="word-wrap: break-word;">
Looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong word
</div>
</td>
<td><span style="display: inline;">Short word</span></td>
</tr>
</table>
text-wrap:suppress
text-wrap:normal
红颜莎娜
波斯汪
精慕HU