TD does not contain Chinese characters string does not wrap, contains the Chinese character's ability to wrap the problem causes and the solution

Source: Internet
Author: User

Today the project encountered a problem, a long string of strings such as: 003403ff0014e54016030cc655bc3242, but such as: Yuhua District, Shijiazhuang City, Hebei Province, China Huai an road Masakiyo street intersection so you can change line.

The reason is: if there is no space between the letters, the system is considered a word and will not be wrapped automatically. This is not the case with Chinese characters.

Workaround:

Use the form to load the content to be displayed.
Add "style= ' table-layout:fixed" to the <table> tag,
Add "style= ' Word-wrap:break-word '" to the <td> tag that will force word wrapping.
That's all you can do.

In Div:

DIV implements long English letter wrap CSS
IE browser
#wrap {white-space:normal; width:200px;}
Or
#wrap {word-break:break-all;width:200px;}

Firefox browser
#wrap {white-space:normal; width:200px; overflow:auto;}
Or
#wrap {word-break:break-all;width:200px; overflow:auto;}

2, do not set the cell width, but the Chinese characters will be automatically wrapped:

Solution: <table style= ' Word-break:keep-all ' >

Turn from: http://www.educity.cn/wenda/7175.html, thanks for the original!

TD does not contain Chinese characters string does not wrap, contains the Chinese character's ability to wrap the problem causes and the solution

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.