jsp中表格,表格中的文字根据表格的大小自动换行

<span style="font-size:18px;">style="table-layout: fixed; word-break: break-all; word-wrap: break-word" 

语法: 
word-break : normal | break-all | keep-all 
参数: 
normal :  依照亚洲语言和非亚洲语言的文本规则,允许在字内换行 
break-all :  该行为与亚洲语言的normal相同。也允许非亚洲语言文本行的任意字内断开。该值适合包含一些非亚洲文本的亚洲文本 
keep-all :  与所有非亚洲语言的normal相同。对于中文,韩文,日文,不允许字断开。适合包含少量亚洲文本的非亚洲文本 

语法:
word-wrap : normal | break-word 
参数:
normal :  允许内容顶开指定的容器边界
break-word :  内容将在边界内换行。如果需要,词内换行(word-break)也行发生
说明:
设置或检索当当前行超过指定容器的边界时是否断开转行。

语法:
table-layout : auto | fixed 
参数:
auto :  默认的自动算法。布局将基于各单元格的内容。表格在每一单元格读取计算之后才会显示出来。速度很慢
fixed :  固定布局的算法。在这算法中,水平布局是仅仅基于表格的宽度,表格边框的宽度,单元格间距,列的宽度,而和表格内容无关</span>
<span style="font-size:18px;">
</span>
<span style="font-size:18px;">但存在问题,单词被截断了:</span>
<span style="font-size:18px;color:#ff0000;"><span style="font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; line-height: 28px;"><strong>使用:</strong></span></span>
<span style="font-size:18px;"><span style="color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; line-height: 28px;">table {</span><br style="line-height: 28px; color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px;" /><span style="color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; line-height: 28px;">table-layout: fixed;</span><br style="line-height: 28px; color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px;" /><span style="color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; line-height: 28px;">word-wrap:break-word;</span><br style="line-height: 28px; color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px;" /><span style="color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; line-height: 28px;">}</span><br style="line-height: 28px; color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px;" /><span style="color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; line-height: 28px;">div {</span><br style="line-height: 28px; color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px;" /><span style="color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; line-height: 28px;">word-wrap:break-word;</span><br style="line-height: 28px; color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px;" /><span style="color: rgb(105, 105, 105); font-family: 'Hiragino Sans GB W3', 'Hiragino Sans GB', Arial, Helvetica, simsun, u5b8bu4f53; font-size: 16px; line-height: 28px;">}</span>
</span>

你可能感兴趣的:(jsp中表格,表格中的文字根据表格的大小自动换行)