函数如下
function print (tablelayid)
{
var v = document.createElement("div");
var f = ["
", "", ""].join("");$(v).append($(".layui-table-box").find(".layui-table-header").html());
$(v).find("tr").after($("[lay-id=\"" + tablelayid+ "\"] .layui-table-body.layui-table-main table").html()); $(v).find("th.layui-table-patch").remove();
$(v).find(".layui-table-col-special").remove();
var h = window.open("打印窗口", "_blank");
h.document.write(f + $(v).prop("outerHTML"));
h.document.close();
h.print();
h.close();
}
效果如下
layui数据表格自定义每页条数limit
table.render({ elem: '#data_grid' //,width: 900 //,height: 274 ,cols: [