Home >Web Front-end >HTML Tutorial >html CSS implements hiding of text exceeding the length and displaying ellipses_html/css_WEB-ITnose

html CSS implements hiding of text exceeding the length and displaying ellipses_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:51:181275browse

Table:

table{
table-layout: fixed;
}
}
t
td{

white- space: nowrap;
​ overflow: hidden; Involving 4 CSS styles:
1. table-layout: fixed Since the default value of table-layout is auto, that is, the width and height of the table will depend on the amount of its content. If the volume of the content cannot be estimated, then in the end The presentation form of the table cannot be guaranteed. It can be fixed. (Note: This style is key)
2. white-space: nowrap is to ensure that no matter how much text content is in the cell (TD), it will not wrap automatically. At this time, the excess content will be broken in the horizontal direction. cell.
3. overflow: hidden hides the part beyond the cell.

4. text-overflow: ellipsis Replace the hidden part with ellipses.




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn