table不让td中文字溢出操作方法

table不让td中文字溢出操作方法


  1. table{  
  2.     width:100px;  
  3.     table-layout:fixed;/* 只有定义了表格的布局算法为fixed,下面td的定义才能起作用。 */  
  4. }  
  5. td{  
  6.     width:100%;  
  7.     word-break:keep-all;/* 不换行 */     
  8.     white-space:nowrap;/* 不换行 */  
  9.     overflow:hidden;/* 内容超出宽度时隐藏超出部分的内容 */  
  10.     text-overflow:ellipsis;/* 当对象内文本溢出时显示省略标记(...) ;需与overflow:hidden;一起使用*/  

posted @ 2017-07-11 14:30  Martin_lee  阅读(322)  评论(0编辑  收藏  举报