Workaround for cell text display over cell width

Source: Internet
Author: User

During development, the display data in table cells often exceeds the width of the cell. This is usually the case with this situation.

1, out-of-section display ellipsis (...)

Workaround: Set text-overflow:ellipsis in CSS;

Text-overflow:


2. Line break display

Workaround: Set white-space:normal in CSS;

White-space: (1) Normal: Default. The blank will be ignored by the browser.

(2) Pre: line breaks and other whitespace characters will be protected

(3) NoWrap: Forces all text to be displayed in the same line until the text ends or encounters a BR object

Example code:

<style type= "Text/css" >
P
{
White-space:normal/pre/nowrap;
}
</style>
<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>

Run: (1)

(2)

(3)

I hope you will give us some advice.

Workaround for cell text display over cell width

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.