.layui-table-cell, .layui-table-col-special {
height: auto;
}
在done中调用
done: function(data) {
autoFixed($(this.elem[0]).next())
}
/**
* 根据表格宽度自动显示右侧浮动栏,并修正浮动栏高度
* @param tableElem 绑定元素的dom
*/
function autoFixed(tableElem) {
var $tableView = tableElem || $(".layui-table-view");
var dataIndex, trHeight;
$tableView.each(function () {
// 获取两侧浮动栏
var $fixed = $(this).find(".layui-table-fixed");
// 同步表头高度
$fixed.find(".layui-table-header tr").height($(this).find(".layui-table-header tr").eq(0).height());
// 遍历tr 修正浮动栏行高
$(this).find(".layui-table-main tr").each(function () {
dataIndex = $(this).attr("data-index");
trHeight = $(this).css("height");
$fixed.find("tr[data-index=" + dataIndex + "]").css("height", trHeight);
})
});
}