• 使用jquery插件实现打印指定区域功能


    程序员话不多,直接上代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
        <head>
            
    <title>支持放大显示效果的TOP排行</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <script type="text/javascript" src="jquery-1.4.2.min.js"></script>    
    <script type="text/javascript" src="jquery.PrintArea.js"></script>    
    <script>  
    $(document).ready(function(){   
      $("input#biuuu_button").click(function(){   
      
      $("div#myPrintArea").printArea();   
      
    });   
    });   
        
    </script>  
    </head>
    <body>  
    <input id="biuuu_button" type="button" value="打印"/> 
      
    <div id="myPrintArea">
        <table width="760"  style="border:0.5px solid #000000" borderColor="#000000" align="center" cellpadding="0" cellspacing="0" class="tableBorder5">
          <tr> 
            <td height="30" colspan="6" align="center" class="TableTitle1"><b>报 修 的 详 细 资 料</b></td>
      </tr>
      <tr align="center" > 
        <td width="118" height="30" class="TableBody1">报修编号:</td>
        <td width="112" height="30" class="TableBody1" ><span class="style2">BX2011082905983</span></td>
        <td width="120" class="TableBody1" >报修地点:</td>
        <td width="136" class="TableBody1" ><span class="style2">
          竹园
        </span></td>
        <td width="134" height="30" class="TableBody1" >故障物品<span lang="en-us">/</span>部件:</td>
            <td width="131" class="TableBody1" ><span class="style2">
              磁卡锁
            </span></td>
      </tr>
          <tr align="center">
            <td width="118" height="30" class="TableBody1" >报修人:</td>
            <td width="112" height="30" class="TableBody1" ><span class="style2">信息员十号</span></td>
            <td width="120" height="30" class="TableBody1" >预约维修日期:</td>
            <td width="136" height="30" class="TableBody1" ><span class="style2">2011-08-29</span></td>
            <td height="30" class="TableBody1" >报修日期:</td>
            <td height="30" class="TableBody1" ><span class="style2">2011-8-29</span></td>
          </tr>
          <tr align="center">
            <td width="118" height="30" class="TableBody1" >联系电话:</td>
            <td width="112" height="30" class="TableBody1" ><span class="style2">15955105802</span></td>
            <td width="120" height="30" class="TableBody1" >预约维修时间:</td>
            <td width="136" height="30" class="TableBody1" ><span class="style2">29号</span></td>
            <td height="30" class="TableBody1" > </td>
            <td height="30" class="TableBody1" > </td>
          </tr>
      <tr > 
        <td width="118" height="30" align="center" class="TableBody1" >报修地址:</td>
        <td height="30" colspan="5" class="TableBody1" >&nbsp;<span class="style2">竹园-1323</span></td>
          </tr>
      <tr >
        <td height="30" align="center" class="TableBody1" >具体故障现象:</td>
            <td colspan="5" class="TableBody1" >&nbsp;<span class="style2">竹园-1323   配钥匙(已交费)</span></td>
      </tr>
     
    </table>
    </div>   
    </body>
    </html>

    效果图:

    不同浏览器效果不同

    google浏览器比较好

    这是IE的效果:

  • 相关阅读:
    IOS客户端Coding项目记录(二)
    IOS客户端Coding项目记录(一)
    IOS开发基础知识--碎片7
    图解域域树域林根域的含义
    Windows server 2012公用网络修改为专用网络
    Windows2012R2版本区别
    VMWare:vSphere6 企业版参考序列号
    Oracle快速测试连接是否成功
    Brocade300 commands
    也谈免拆机破解中兴B860av1.1(解决不能安装软件/解决遥控)
  • 原文地址:https://www.cnblogs.com/smile361/p/2649894.html
Copyright © 2020-2023  润新知