`
king_tt
  • 浏览: 2124285 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

table中文本太长单元格换行

 
阅读更多
<table width="480" border="0" cellspacing="0" cellpadding="0"style="word-break:break-all;word-wrap:break-word">
<tr>
<td>希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。希望能够换行。</td>
</tr>
</table>
解释:
语法:

word-break : normal | break-all | keep-all

参数:

normal :  依照亚洲<nobr id="key0" style="font-family:Verdana; font-size:13px; line-height:19px; background-color:transparent; color:rgb(102,0,255); border-bottom-color:rgb(102,0,255); border-bottom-width:1px; border-bottom-style:dotted; text-decoration:underline">语言</nobr>和非亚洲语言的文本规则,允许在字内换行
break-all :  该行为与亚洲语言的normal相同。也允许非亚洲语言文本行的任意字内断开。该值适合包含一些非亚洲文本的亚洲文本
keep-all :  与所有非亚洲语言的normal相同。对于<nobr id="key3" style="font-family:Verdana; font-size:13px; line-height:19px; background-color:transparent; color:rgb(102,0,255); border-bottom-color:rgb(102,0,255); border-bottom-width:1px; border-bottom-style:dotted; text-decoration:underline">中文</nobr>,韩文,日文,不允许字断开。适合包含少量亚洲文本的非亚洲文本

说明:

<nobr id="key4" style="font-family:Verdana; font-size:13px; line-height:19px; background-color:transparent; color:rgb(102,0,255); border-bottom-color:rgb(102,0,255); border-bottom-width:1px; border-bottom-style:dotted; text-decoration:underline">设置</nobr>或检索对象内文本的字内换行行为。尤其在出现多种语言时。
对于中文,应该使用break-all 。
对应的脚本特性为wordBreak。请参阅我编写的其他书目。

word-wrap版本:IE5.5+专有属性 继承性:有


语法:

word-wrap : normal | break-word

参数:

normal :  允许<nobr id="key1" style="font-family:Verdana; font-size:13px; line-height:19px; background-color:transparent; color:rgb(102,0,255); border-bottom-color:rgb(102,0,255); border-bottom-width:1px; border-bottom-style:dotted; text-decoration:underline">内容</nobr>顶开指定的容器边界
break-word :  内容将在边界内换行。如果需要,词内换行(word-break)也行发生

说明:

设置或检索当当前行超过指定容器的<nobr id="key5" style="font-family:Verdana; font-size:13px; line-height:19px; background-color:transparent; color:rgb(102,0,255); border-bottom-width:2px; border-bottom-style:dotted; text-decoration:underline">边界</nobr>时是否断开转行。
对应的脚本特性为wordWrap。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics