繁体   English   中英

表格单元格中的溢出文本

[英]Overflow text in a table cell

我有一个长字符串的文件路径没有空格。 例如:

这显示在table ,如:

<td>
    /thisisthetopfolder/thisisthebottomfolder/thisisthefile.html
</td>

但是,文本不会溢出到下一行,它只是在表格单元格宽度的末尾被截断/截断。 我无法增加表格或表格单元格的宽度。 有没有办法强制溢出表格单元格中的文本,以便它不会被切断?

它看起来像这样:

------------------------------------------
| /thisisthetopfolder/thisi | other info  |
------------------------------------------

它需要看起来像这样:

------------------------------------------
| /thisisthetopfolder/thisi  |            |
|  sthebottomfolder/thisisth |            |
|  efile.html                | other info |
------------------------------------------

添加此CSS规则:

td {
    word-break:break-word;
}

jsFiddle例子

word-break CSS属性用于指定如何(或如果)断开单词中的行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM