Resolves content in an HTML table that is not forced to wrap and is out of width auto-hide and display ellipses

Source: Internet
Author: User

In the table layout is often encountered because the table content changes caused by the layout confusion, this time we may have to stabilize the layout of the cell width to write dead, but we set the width but found beyond the width will automatically become larger, using CSS to define the elements of the Overflow:hidden; properties are not possible; the last solution to find is as follows:

table{       table-layout:fixed;/* only the layout algorithm that defines the table is fixed, and the following TD definition will work. */}td{    width:100%;    word-break:keep-all;/* do not wrap */    white-space:nowrap;/* do not wrap */    overflow:hidden;/* content beyond the width to hide the contents of the outside part of the * *    text-overflow:ellipsis;/* display ellipsis (...) when text inside an object overflows; use with Overflow:hidden; */}


If you're worried about hiding the full cell content, it is recommended that you add the Title property value above the cell to the full contents of the cell so that you can show it all as long as the mouse is over.

Resolves content in an HTML table that is not forced to wrap and is out of width auto-hide and display ellipses

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.