日期:2014-05-16  浏览次数:20898 次

jquery PrintArea 打印指定区域问题?为啥指定不了,打印出来还是一整页,为什么? - Web 开发 / Ajax
jquery PrintArea 打印指定区域问题?为啥指定不了,打印出来还是一整页,为什么?
HTML code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="com.hzj.portal.student.vo.money"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="java.util.*"%>

<html> 
    <head>
        <title>现金交接表</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
        <link rel="stylesheet" type="text/css" href="${portal}/css/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="${portal}/css/index.css">
        <link rel="stylesheet" type="text/css" href="../css/icon.css">
        <script type="text/javascript" src="${portal}/js/jquery-1.4.2.min.js"></script>
        <script type="text/javascript" src="${portal}/js/jquery.easyui.min.js"></script>                  
         <script type="text/javascript" src="${portal}/js/calendar/WdatePicker.js"></script>    
        <script type="text/javascript" src="${portal}/js/PrintArea.js"></script>
 <script>
    $("a#PrintArea").click(function(){
      $("span.PrintArea").printArea( {popX: 500, popY: 400,popTitle:'现金交接'});
    });
</script>
</head>
    <body style="text-align:center;">
        <!--startprint-->
        <div id="print" class="easyui-window" title="现金交接"
            iconCls="icon-save"
            style="width: 980px; height: 450px; padding: 5px;top:10px; background: #fafafa;" modal="false" shadow="false" maximizable="false" collapsible="false" closed="false" minimizable="false">
            <div  class="easyui-layout" fit="true" >
                <div region="center" border="false"
                    style="padding: 10px; background: #fff; border: 1px solid #ccc;">
                      <!--想从这开始打印,上面的部分不打印,但现在上面的部份还是打印了-->
                     <span  id="PrintArea">                                  <table width="443" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr>
                          <td height="50" align="center" id="fp_title">现金交接表</td>
                        </tr>
                      </table>
         <table width="620" border="0" cellpadding="0" cellspacing="1" bordercolor="#000000" bgcolor="#000000">
        <tr>
        <td width="61" height="40" align="center" bgcolor="#FFFFFF">交易量</td>
        <td width="94" align="center" bgcolor="#FFFFFF">学费累计</td>
        <td width="82" align="center" bgcolor="#FFFFFF">教材费累计</td>
        <td width="58" align="center" bgcolor="#FFFFFF" >总计</td>
        <td width="101" align="center" bgcolor="#FFFFFF" >日期</td>
        <td width="85" align="center"