CSS forced wrap CSS forced to do not wrap CSS method _ Experience Exchange

Source: Internet
Author: User
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> 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.