首先设置 css样式:

    table { table-layout: fixed;}

HTML中的table代码:

<tr>
<th class="col-md-1">用户ID</th>
<th class="col-md-1">用户名</th>
<th class="col-md-1">联系电话</th>
<th class="col-md-1">邮箱</th>
<th class="col-md-4">描述 </th>
<th class="col-md-2">添加时间</th>
<th class="col-md-2">操作</th>
</tr>
【对于bootstrap应该设置th的固定宽度】

设置td超过固定宽度自动显示为省略号:
table tr td {
overflow:hidden;
white-space:nowrap;
text-overflow:ellipsis;
-o-text-overflow:ellipsis;
-moz-text-overflow: ellipsis;
-webkit-text-overflow: ellipsis;
}

相关文章:

  • 2021-12-30
  • 2022-12-23
  • 2022-02-15
  • 2021-10-23
  • 2021-06-30
  • 2021-09-15
  • 2021-06-01
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2021-11-21
相关资源
相似解决方案