如何实现table内过长文字用省略号显示:


  table内设置该属性和普通的div设置该属性是不一样的,以下是正确的设置table内显示该样式    

 

   1.table必须加宽度值
  2.table必须加table-layour: fixed;属性
  3.给每个<td>加四个属性。

 

table tr td{
text-overflow:ellipsis;
width: 100px;
white-space: nowrap;
overflow: hidden;

}


table{
table-layout: fixed;
width: 400px;
}

  

posted @ 2017-05-04 19:51  samous  阅读(324)  评论(0)    收藏  举报