Form:
table{
table-layout:fixed;
}
}
T
td{
White-space:nowrap;
Overflow:hidden;
Text-overflow:ellipsis;
}
}
This method is used to solve the problem of aesthetic appearance when there are too many contents of table cells, mainly involving 4 CSS styles:
1. table-layout:fixed because the default value of Table-layout is auto, that is, the width of the table will depend on the size of its content, if the volume of the content can not be estimated, then the final form of the form can not be guaranteed, fixed a bit better. (Note: This style is key)
2. White-space:nowrap is to ensure that no matter how many Chinese text content in the cell (TD), will not automatically wrap, the extra content in the horizontal direction bursting cells.
3. Overflow:hidden hides the portion of the cell beyond the cells.
4. Text-overflow:ellipsis replaces the hidden part with an ellipsis.
Original address: http://www.itmmd.com/201410/92.html
The article is published by the Android Development and distribution, reproduced must be marked by the source. .
HTML + CSS Implementation text out of length hidden, display ellipsis