版权声明:毒牙工作室 https://blog.csdn.net/qq_35023116/article/details/83268537
轻轻的我走了,正如我轻轻的来,我轻轻的招手,作别西天的云彩。 -- 徐志摩《再别康桥》
/**
* 打印 在不需要打印的地方加上id="noprint"属性
* */
function printdiv() {
document.getElementById("noprint").style.display = "none";
var newstr = document.body.innerHTML;
document.getElementById("noprint").style.display = "block";
var oldstr = document.body.innerHTML;
document.body.innerHTML = newstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
注意:
1、使用layui制作出来的表格,用浏览器打印线条不全。