配置两个地方
一:修改样式
<!-- 解决单元格换行问题 -->
<style type="text/css">
.layui-table-cell {
height:auto;
overflow:visible;
text-overflow:inherit;
white-space:normal;
word-break: break-all;
}
</style>
二:加载表格后done回调
, done: function (res, curr, count) {
// console.log(res)
//解决操作栏因为内容过多换行问题
$(".layui-table-main tr").each(function (index, val) {
$($(".layui-table-fixed-l .layui-table-body tbody tr")[index]).height($(val).height());
$($(".layui-table-fixed-r .layui-table-body tbody tr")[index]).height($(val).height());
});
}
显示如下: