We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
常规的给td 设置样式
table td{ overflow:hidden; text-overflow:ellipsis; }
表格该换行还是继续换行, 该占多大宽度还是占多大。 这个很坑爹,为什么不起作用呢?
CSS控制文本超出指定宽度后用省略号代替,CSS控制文本不换行。 一般的文字截断(适用于内联与块):
.text-overflow { display:block;/*内联对象需加*/ width:31em; word-break:keep-all;/* 不换行 */ white-space:nowrap;/* 不换行 */ overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */ text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/ }
对于表格文字溢出的定义: 对于表格超出范围显示省略号
table{ width:30em; table-layout:fixed;/* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */ } td{ width:100%; word-break:keep-all;/* 不换行 */ white-space:nowrap;/* 不换行 */ overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */ text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用。*/ }
需要你注意的是,这个CSS样式只对单行的文字的效,如果你想把它用在多行上,也只有第一行有作用的。 这个写法只有IE会有“...”,
其它的浏览器文本超出指定宽度时会隐藏。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题
常规的给td 设置样式
表格该换行还是继续换行, 该占多大宽度还是占多大。 这个很坑爹,为什么不起作用呢?
CSS控制文字超出则显示 ...
CSS控制文本超出指定宽度后用省略号代替,CSS控制文本不换行。
一般的文字截断(适用于内联与块):
Table td 强制不换行,超出 则 显示 ...
对于表格文字溢出的定义:
对于表格超出范围显示省略号
table-layout
效果
需要你注意的是,这个CSS样式只对单行的文字的效,如果你想把它用在多行上,也只有第一行有作用的。 这个写法只有IE会有“...”,
其它的浏览器文本超出指定宽度时会隐藏。
以上问题可以解决
The text was updated successfully, but these errors were encountered: