layui表格内容溢出的解决方法

(编辑:jimmy 日期: 2025/12/11 浏览:2)

引言,我做文章管理的时候,引入的是layui的表格样式,但是里面的内容溢出无法隐藏,后来我采用了往td里面加了个<div></div>

然后设置一下样式就可以了。


 <table class="layui-table">
 <colgroup>
 <col width="100">
 <col width="150">
 <col>
 </colgroup>
 <thead>
 <tr>
  <th>序号</th>
  <th>文章标题</th>
  <th>文章内容</th>
  <th>发布时间</th>
  <th>发布人</th>
  <th>操作</th>
 </tr> 
 </thead>
 <tbody>
 <c:forEach items="${pageInfo.list}" var="a">
 <tr style="height:auto;">
  <td class="lid">${a.aId}</td>
  <td>${a.aTitle }</td>
  <td class="ac" style=""><div style="width:500px;
overflow:hidden; 
white-space:nowrap; 
text-overflow:ellipsis;">${a.aContent}</div></td>
  <td><fmt:formatDate type="both" dateStyle="long" timeStyle="long" value="${a.aTime}" /></td>
  <td>${a.whoRelease}</td> 
  <td>
  <button class="layui-btn-danger layui-btn layui-delete"><i class="layui-icon">&#xe640;</i></button></td> 
 </tr>
 </c:forEach>
 
 </tbody>
</table>

以上这篇layui表格内容溢出的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

一句话新闻
高通与谷歌联手!首款骁龙PC优化Chrome浏览器发布
高通和谷歌日前宣布,推出首次面向搭载骁龙的Windows PC的优化版Chrome浏览器。
在对骁龙X Elite参考设计的初步测试中,全新的Chrome浏览器在Speedometer 2.1基准测试中实现了显著的性能提升。
预计在2024年年中之前,搭载骁龙X Elite计算平台的PC将面世。该浏览器的提前问世,有助于骁龙PC问世就获得满血表现。
谷歌高级副总裁Hiroshi Lockheimer表示,此次与高通的合作将有助于确保Chrome用户在当前ARM兼容的PC上获得最佳的浏览体验。