1

<style type="text/css">
2


.text-overflow

{
3


display:block;/**//*内联对象需加*/
4

width:31em;
5


word-break:keep-all;/**//* 不换行 */
6


white-space:nowrap;/**//* 不换行 */
7


overflow:hidden;/**//* 内容超出宽度时隐藏超出部分的内容 */
8


text-overflow:ellipsis;/**//* 当对象内文本溢出时显示省略标记(

) ;需与overflow:hidden;一起使用。*/
9

}
10

</style>
11
Html 使用代码(GridView 等数据控件也对应Html使用)


Table使用省略号
1

<table class=text-overflow style="table-layout: fixed; width: 222px;">
2

<tr>
3

<td style="width: 20; word-break: keep-all; white-space: nowrap; overflow: hidden;
4

text-overflow: ellipsis;">
5

这里是过长的问题这里是过长的问这里是过长的问题 </td>
6

</tr>
7

</table>
8