HTML continuous English string forced wrap

Source: Internet
Author: User

Everyone knows that when you insert text into a box in a table, if it is Chinese, of course, there is no problem, when the specified width will be automatically wrapped, but if it is in English or numbers and so on there will be a problem. Because it is the difference between English words with a space, but if you enter a long string of English, with no spaces in the middle, The table is deformed. But in fact table's style has one to be able to make the English to be forced to change the line, is Word-break, when this set is Break-all, everybody can see the effect.

Sample code:

<table width="100%" style="word-break:break-all">

<td width="20%">

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

</td><td width="80%"></td></table>

Take this copy to the body to see the advance.

Word-break also has two options: normal is the usual and does not set the effect.

Keep-all: It's the opposite of Break-all, no matter what characters don't wrap without spaces and line breaks

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.