场景:

最左边这栏我不行让他换行,怎么办呢?

下面是解决办法:

 

[plain] view plain copy
 
  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;一起使用*/  
  11. }  

参考:http://www.52design.com/html/201007/design201071123721.shtml

现在:

转自:https://github.com/wusuopubupt https://blog.csdn.net/wusuopuBUPT/article/details/21729985
posted on 2018-03-27 11:03  Sharpest  阅读(393)  评论(0编辑  收藏  举报