Solution: the cell width is exceeded when the text in the cell is displayed.

Source: Internet
Author: User

Solution: the cell width is exceeded when the text in the cell is displayed.

During development, the data displayed in table cells often exceeds the cell width. This is generally the case.

1. The ellipsis (...) is displayed in the excess part (...)

Solution: set text-overflow: ellipsis in css;

Text-overflow:


2. line feed display

Solution: Set white-space: normal in css;

White-space :( 1) normal: default. The blank space is ignored by the browser.

(2) pre: line breaks and other blank characters will be protected

(3) nowrap: forces all texts to be displayed in the same row until the text ends or the br object is encountered.

 

Sample Code:

<Html>
<Head>
<Style type = "text/css">
P
{
White-space: normal/pre/nowrap;
}
</Style>
</Head>
<Body>

<P>
This is some text.
This is some text.
This is some text.
This is some text.
This is some text.
This is some text.
This is some text.
This is some text.
This is some text.
This is some text.
This is some text.
This is some text.
</P>

</Body>
</Html>

Run: (1)

(2)

(3)

I hope you can give me some comments.

 

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.