輕輕的我走了,正如我輕輕的來,我輕輕的招手,作別西天的雲彩。 -- 徐志摩《再別康橋》
/**
* 打印 在不需要打印的地方加上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製作出來的表格,用瀏覽器打印線條不全。