Javascript: a function for automatically wrapping custom-length text _ javascript skills

Source: Internet
Author: User
Javascript: a function for auto-wrapping of custom-length text. Many friends always find that some English words may open the original good table and cause deformation during webpage creation, although you can use style = "table-layout: fixed; word-wrap: break-word; word-break: break-all" to solve this problem, however, sometimes the content is hidden due to incomplete display, and the effect of automatic line feed is not achieved.

So I want to write a function like this to fix this defect. This function is very simple, but it only provides a way to solve this problem.

Function fnAddBr (id, iPerLineLen ){.....}
Id is the id of the text block to be modified, and iPerLineLen is the length of each line.




Untitled Document


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.