Php implements the print preview function, and php implements print preview.
<Inputid = "btnPrint" type = "button" value = "print" onclick = "javascript: window. print (); "/> <inputid =" btnPrint "type =" button "value =" print preview "onclick = preview (1) /> <styletype = "text/css" media = print>. noprint {display: none }</style> <pclass = "noprint"> areas that do not need to be printed </p> <script> functionpreview (outputs) {if (then <102.1620.bdhtml#20.20.doc ument. body. innerHTML; // obtain the html code sprnstr = "<! -Startprint "+ print +"-> "; // you can specify eprnstr =" <! -Endprint "+ outputs +"-> "; // set the print end area prnhtml = bdhtml. substring (bdhtml. indexOf (sprnstr) + 18); // obtain htmlprnhtmlprnhtml = prnhtml from the start code. substring (0, prnhtml. indexOf (eprnstr); // obtain html?document.body.innerhtml=prnhtml###print({windowindow.doc ument. body. innerHTML = bdhtml;} else {window. print () ;}</script> <p> XXXXX </p> <! -Startprint1-> content to be printed <! -Endprint1-> <inputid = "btnPrint" type = "button" value = "print" onclick = "javascript: window. print (); "/> <inputid =" btnPrint "type =" button "value =" print preview "onclick = preview (1) /> <styletype = "text/css" media = print>. noprint {display: none }</style> <pclass = "noprint"> areas that do not need to be printed </p> <script> functionpreview (outputs) {if (then <102.1620.bdhtml#20.20.doc ument. body. innerHTML; // obtain the html code sprnstr = "<! -Startprint "+ print +"-> "; // you can specify eprnstr =" <! -Endprint "+ outputs +"-> "; // set the print end area prnhtml = bdhtml. substring (bdhtml. indexOf (sprnstr) + 18); // obtain htmlprnhtmlprnhtml = prnhtml from the start code. substring (0, prnhtml. indexOf (eprnstr); // obtain html?document.body.innerhtml=prnhtml###print({windowindow.doc ument. body. innerHTML = bdhtml;} else {window. print () ;}</script> <p> XXXXX </p> <! -Startprint1-> content to be printed <! -Endprint1->