Let's go

打印实例

1.demo1

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="UTF-8">
 5         <title></title>
 6         <style type="text/css">
 7             .tab1{
 8                 border: 1px solid black;
 9                 border-collapse: collapse;
10             }
11             .tab1 tr{
12                 border: 1px solid black;
13                 border-collapse: collapse;
14             }
15             .tab1 tr td{
16                 border: 1px solid black;
17                 border-collapse: collapse;
18             }
19         </style>
20         <style type="text/css" media="print">
21             .btn {
22                 display: none;
23             }
24         </style>
25     </head>
26     <body>
27         <input class="btn" type="button" value="打  印" onclick="window.print();"
28                         name="btn_print " />
29         <table class="tab1">
30             <tr>
31                 <td>111</td>
32                 <td>222</td>
33                 <td>444</td>
34                 <td>333</td>
35             </tr>
36         </table>
37     </body>
38 </html>

 

posted @ 2019-02-14 13:29  chenze  阅读(128)  评论(0编辑  收藏  举报
有事您Q我