css 之table td 内容超出 ... 显示,不撑开td ,不换行,... 显示样式方法

.conlistbox {
    
    
    position: relative;
    width: 100%;
    font-size: 14px;
    line-height: 40px;
    color: #333;
    table-layout: fixed;  // 这里是重点!!
}
    th,
    td {
    
    
      width: 100px;
      height: 40px;
      padding: 0 5px;
      box-sizing: border-box;
      border: 1px solid #eee;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }

给table添加样式:table-layout: fixed;

猜你喜欢

转载自blog.csdn.net/ws19900201/article/details/108434332