网页打印代码

来源:互联网 发布:ubuntu进入root文件夹 编辑:程序博客网 时间:2024/05/22 11:43

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"
  <title>页面打印</title>
   <style type="text/css">
  
   .table{
   text-align:center;
   }
  
   </style>
  
   <style media="print">    
.Noprint{display:none;}    
.PageNext{page-break-after:   always;}    
</style>
</head>
<body>
<center class="Noprint">
            <p>
                <object id="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0"
                    width="0">
                </object>
                <input type="button" value="打印" onclick="document.all.WebBrowser.ExecWB(6,1)">
                <input type="button" value="直接打印" onclick="document.all.WebBrowser.ExecWB(6,6)">
                <input type="button" value="页面设置" onclick="document.all.WebBrowser.ExecWB(8,1)">
            </p>
            <p>
                <input type="button" value="打印预览" onclick="document.all.WebBrowser.ExecWB(7,1)"></p>
        </center>
        <hr />
        <span>我是僵尸</span>
</body>
</html>