用css实现table中超长字符串省略号表示

效果如图

用css实现table中超长字符串省略号表示_第1张图片

代码:

<style>
table td{white-space:nowrap;overflow:hidden; text-overflow:ellipsis;}
table  {table-layout:fixed;}
</style>
注意!给TD指定宽度(否则宽度自动分配,达不到理想的效果).


你可能感兴趣的:(用css实现table中超长字符串省略号表示)