Html + CSS: Hide the text beyond the length and display the ellipsis,
Table:
Table {
Table-layout: fixed;
}
}
T
Td {
White-space: nowrap;
Overflow: hidden;
Text-overflow: ellipsis;
}
}
This method is used to solve the problem of the appearance of too many table cells, mainly involving four CSS styles:
1. table-layout: fixed because the default value of table-layout is auto, that is, the width and height of a table depend on the quantity of its content. If the volume of the content cannot be estimated, therefore, the final form of the table cannot be guaranteed, and fixed is enough. (Note: This style is critical)
2. white-space: nowrap is used to ensure that no text is automatically wrapped regardless of the number of text content in the cell (TD). In this case, the excess content will break through the cell horizontally.
3. overflow: Hide the part beyond the cell.
4. text-overflow: ellipsis replaces the hidden part with a ellipsis.
Address: http://www.itmmd.com/201410/92.html
This article is organized and published by android Developers. The source must be indicated ..