Previously summed up the DIV and do not change the line of CSS. But for a table cell to know only one property nowrap can make it not wrap.
Recently there is such a need, but found that plus nowrap in some cases will be changed line! Helpless, does not have a force does not change the line method?
Baidu a bit, so I am very relieved, and really found a way to solve the problem.
use CSS to implement table cell data wrapping or no line wrapping
1, Automatic line wrapping:
<style type= "Text/css" >. Autonewline {word-break:break-all;/* must/} </style> <table> <tr> <td class= "Auto NewLine "> Automatic line wrap automatic line wrap automatic line wrap automatic line wrap automatic line wrap automatic line wrap automatic line wrap automatic wrapping line automatic line wrap automatic line wrap automatic line wrap automatic line wrap automatic line wrap automatic line wrap automatic line wrap automatic wrapping line </td> </tr> </table>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
2, do not change lines:
Copy Code code as follows:
<style type= "Text/css" >
. nonewline
{
word-break: keep-all;/* must */
}
</style>
<table>
<tr>
<td class= "Nonewline" > Do not wrap the line does not wrap line does not wrap line does not wrap line does not wrap the line does not change the line does not change the line does not wrap the line to do not wrap </td>
</tr>
</table>