<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    溫馨提示:您的每一次轉(zhuǎn)載,體現(xiàn)了我寫此文的意義!!!煩請您在轉(zhuǎn)載時注明出處http://www.tkk7.com/sxyx2008/謝謝合作!!!

    雪山飛鵠

    溫馨提示:您的每一次轉(zhuǎn)載,體現(xiàn)了我寫此文的意義!!!煩請您在轉(zhuǎn)載時注明出處http://www.tkk7.com/sxyx2008/謝謝合作!!!

    BlogJava 首頁 新隨筆 聯(lián)系 聚合 管理
      215 Posts :: 1 Stories :: 674 Comments :: 0 Trackbacks
    方法一
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      
    <head>
        
    <base href="<%=basePath%>">
        
        
    <title>table</title>
        
        
    <meta http-equiv="pragma" content="no-cache">
        
    <meta http-equiv="cache-control" content="no-cache">
        
    <meta http-equiv="expires" content="0">    
        
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        
    <meta http-equiv="description" content="This is my page">
        
    <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        
    -->
        
    <style type="text/css">
            body
    {
                margin
    : 0,0,0,0;
            
    }
            td
    {
                border
    :1px solid;
                border-collapse
    : collapse;
                border-color
    : blue;
            
    }
        
    </style>
        
        
    <script type="text/javascript">
            
    function printdiv(printpage){
                
    var headstr = "<html><head><title></title></head><body>";
                
    var footstr = "</body>";
                
    var newstr = document.all.item(printpage).innerHTML;
                
    var oldstr = document.body.innerHTML;
                document.body.innerHTML 
    = headstr+newstr+footstr;
                window.print(); 
                document.body.innerHTML 
    = oldstr;
                
    return false;
            } 
        
    </script>
      
    </head>
      
      
    <body>
       
    <br>
    <div id="printdiv">
        
    <table width="80%"  border="1px solid" bordercolor="blue" id="mytable" style="border-collapse: collapse;">
           
    <caption>雇員明細表</caption>
           
    <tr>
               
    <th>編號</th>
               
    <th>姓名</th>
               
    <th>性別</th>
               
    <th>年齡</th>
           
    </tr>
           
    <tr>
               
    <td>1</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>2</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>3</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>4</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>5</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>6</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
       
    </table>
       
    <img alt="點我試試看" src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.png">
    </div>
       
    <input type="button" value="打印表格" onclick="printdiv('printdiv');">
      
    </body>
    </html>
    方法二
    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      
    <head>
        
    <base href="<%=basePath%>">
        
        
    <title>table</title>
        
        
    <meta http-equiv="pragma" content="no-cache">
        
    <meta http-equiv="cache-control" content="no-cache">
        
    <meta http-equiv="expires" content="0">    
        
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        
    <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        
    -->
        
    <style type="text/css">
            body
    {
                margin
    : 0,0,0,0;
            
    }
            td
    {
                border
    :1px solid;
                border-collapse
    : collapse;
                border-color
    : blue;
            
    }
        
    </style>
        
        
    <!-- 此樣式用來標記那些不需要被打印的內(nèi)容 -->
        
    <style type="text/css" media=print>
        .noprint
    {display : none }
        
    </style>
        
        
      
    </head>
      
    <body>
       
    <br>
    <div id="printdiv">
        
    <table width="80%"  border="1px solid" bordercolor="blue" id="mytable" style="border-collapse: collapse;">
           
    <caption>雇員明細表</caption>
           
    <tr>
               
    <th>編號</th>
               
    <th>姓名</th>
               
    <th>性別</th>
               
    <th>年齡</th>
           
    </tr>
           
    <tr>
               
    <td>1</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>2</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>3</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>4</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>5</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
           
    <tr>
               
    <td>6</td>
               
    <td>張三</td>
               
    <td></td>
               
    <td>28</td>
           
    </tr>
       
    </table>
       
    <img alt="點我試試看" src="http://www.google.com.hk/intl/zh-CN/images/logo_cn.png" class="noprint">
    </div>
       
    <object id="WebBrowser" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
       
    </object>
       
    <input type="button" name="Button" value="打印設(shè)置" onclick="document.all.WebBrowser.ExecWB(8,1)" class="noprint">
       
    <input type="button" name="Button" value="打印" onclick="document.all.WebBrowser.ExecWB(6,1)" class="noprint">
       
    <input type="button" name="Button" value="打印預(yù)覽" onclick="document.all.WebBrowser.ExecWB(7,1)" class="noprint">
      
    </body>
    </html>
    posted on 2010-12-08 14:01 雪山飛鵠 閱讀(1520) 評論(0)  編輯  收藏 所屬分類: js
    主站蜘蛛池模板: 成人亚洲网站www在线观看| 亚洲国产欧洲综合997久久| 国产免费观看网站| 一区二区在线免费观看| 婷婷亚洲综合一区二区| 亚洲同性男gay网站在线观看| 亚洲日本韩国在线| 日本高清免费不卡在线| 亚洲精品免费网站| 久久大香香蕉国产免费网站| 无遮挡国产高潮视频免费观看| 亚洲熟妇无码八V在线播放| 亚洲视屏在线观看| 亚洲国产精品一区二区久久hs| 伊在人亚洲香蕉精品区麻豆| 成年女人毛片免费播放视频m| 99在线视频免费| 久久精品免费观看| 久久久久久久国产免费看| 香港经典a毛片免费观看看| 亚洲一卡一卡二新区无人区 | 亚洲精华液一二三产区| 亚洲国产精品网站久久| 亚洲天堂视频在线观看| 亚洲成色WWW久久网站| 浮力影院亚洲国产第一页| 亚洲精品线路一在线观看| 亚洲AV成人潮喷综合网| 国产免费人成在线视频| 国产乱人免费视频| 四虎永久在线免费观看| 国产国产人免费视频成69大陆 | 亚洲剧场午夜在线观看| 久久亚洲AV成人无码软件| 精品亚洲成a人片在线观看少妇| 亚洲a在线视频视频| 亚洲午夜久久久精品影院| 亚洲网址在线观看你懂的| 在线电影你懂的亚洲| 亚洲最大的视频网站| 精品亚洲AV无码一区二区|