-- 作者:zhirui
-- 发布时间:2013-10-10 11:08:02
-- ASP在线网页打印代码分享
<html> <head> <title>打印</title> <meta http-equiv="Content-Type" c> <script language=javascript> function preview() { bdhtml=window.document.body.innerHTML; sprnstr="<!--startprint-->"; eprnstr="<!--endprint-->"; prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); window.document.body.innerHTML=prnhtml; window.print(); window.document.body.innerHTML=bdhtml; } </script> </head> <body> <input type="button" value="打印">
<!--startprint--> <table width="98%" border="0" cellpadding="0" cellspacing="2" align="center"> <tr> <td height="21" align="center"><h1>快递单</h1></td> </tr> <tr> <td height="131" align="center"> 这里可以用任何形式的表示方式(比如table,比如div)来限制和调整快递单子上的内容! </td> </tr> </table> <!--endprint--> </body> </html>
|