General line feed and forced line feed of gridview

Source: Internet
Author: User
The data bound to a column in the gridview is very long, and displayed in a row. The page is very wide.
The reason is that the continuous English segment is a whole. In rowdatabound, add the following sentence:
E. Row. cells [2]. style. Add ("word-break", "Break-all.

// Normal line feed
Gridview1.attributes. Add ("style", "word-break: Keep-all; Word-wrap: normal ");
// The following line is a line feed
Gridview1.attributes. Add ("style", "word-break: Break-all; Word-wrap: Break-word ");

In short: Use the word-break: Break-all; Word-wrap: Break-word attribute of CSS, this attribute is common and can be used to solve the problem of stubborn line breaks or the field in the header to be controlled without line breaks. It is not limited to the gridview.

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.