layui数据表格增加自动换行后,固定列错乱变形

2021-04-25
.layui-table-cell {
    font-size:14px;
    padding:0 5px;
    height:auto;
    overflow:visible;
    text-overflow:inherit;
    white-space:normal;
    word-break: break-all;
}
table.render({
    elem: '#test'
    ,url:url
    ,height: "full-100"
    ,autoSort:false
    ,cols: [],
    data:[],
    done: function(res, curr, count){
        // 循环重新渲染高度
        $(".layui-table-main  tr").each(function (index ,val) {
            $($(".layui-table-fixed .layui-table-body tbody tr")[index]).height($(val).height());
        });
        // 修改固定列的高度
        $(".layui-table-header").eq(1).find("tr").eq(0).height($(".layui-table-header").eq(0).find("tr").eq(0).height());
    },
})

文章来源于:https://blog.csdn.net/Whales_w/article/details/113436245,https://blog.csdn.net/cdsn13082487212/article/details/91039184

{/if}