解决 layui table 一个单元格显示多行数据,以及操作栏样式错乱问题

{ "title": "礼品", "width": "200", "templet": function (d) { return getOrderItemInfo(d.orderItemInfo); } },
function getOrderItemInfo(objArry) {
        var strHtml = "<div>";
        $.each(objArry, function (i, ele) {
            strHtml += ele.goodsName + "&nbsp; x" + ele.quantity + "<br/>";
        })
        strHtml += "</div>";
        return strHtml;
    }

效果如下:

发现操作栏样式错乱了,

解决如下 在table.render({})中添加

 ,done: function(res, curr, count){
            $(".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());
            })
          }

完美解决

 参考链接:http://www.zhangfayuan.cn/201912578.htm

原文地址:https://www.cnblogs.com/SmilePastaLi/p/13784621.html