var printBodyHtml = "";
var tableName = $("#printContent").html(); //获取页面html
if(printBodyHtml == ""){
printBodyHtml = "<!DOCTYPE html> <html><head><meta charset='utf-8'><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'></head><body><div>" + tableName + "</div></body></html>"
}
w=window.open('about:blank');
w.document.write(printBodyHtml);
w.print();
w.document.close();
html打印
最新推荐文章于 2022-04-08 15:38:33 发布