• JS打印表格(HTML定义格式)


    <html xmlns:o="urn:schemas-microsoft-com:office:office"
    xmlns:x="urn:schemas-microsoft-com:office:excel"
    xmlns="http://www.w3.org/TR/REC-html40">

    <head>
    <meta http-equiv=Content-Type content="text/html; charset=utf-8">
    <meta name=ProgId content=Excel.Sheet>
    <meta name=Generator content="Microsoft Excel 11">
    <link rel=File-List href="工作日志.files/filelist.xml">
    <style id="环境调查_11939_Styles">
    table
    {mso-displayed-decimal-separator:".";
    mso-displayed-thousand-separator:"\,";}
    .font511939
    {color:windowtext;
    font-size:9.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;}
    .xl6311939
    {padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;
    mso-number-format:General;
    text-align:center;
    vertical-align:middle;
    border:.5pt solid windowtext;
    mso-background-source:auto;
    mso-pattern:auto;
    white-space:normal;}
    .xl6411939
    {padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;
    mso-number-format:General;
    text-align:center;
    vertical-align:middle;
    mso-background-source:auto;
    mso-pattern:auto;
    white-space:normal;}
    .xl6511939
    {padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;
    mso-number-format:General;
    text-align:center;
    vertical-align:middle;
    border-top:.5pt solid windowtext;
    border-right:none;
    border-bottom:none;
    border-left:none;
    mso-background-source:auto;
    mso-pattern:auto;
    white-space:normal;}
    .xl6611939
    {padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;
    mso-number-format:General;
    text-align:center;
    vertical-align:middle;
    border-top:.5pt solid windowtext;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:.5pt solid windowtext;
    mso-background-source:auto;
    mso-pattern:auto;
    white-space:normal;}
    .xl6711939
    {padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;
    mso-number-format:General;
    text-align:center;
    vertical-align:middle;
    border-top:.5pt solid windowtext;
    border-right:.5pt solid windowtext;
    border-bottom:.5pt solid windowtext;
    border-left:none;
    mso-background-source:auto;
    mso-pattern:auto;
    white-space:normal;}
    .xl6811939
    {padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:22.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;
    mso-number-format:General;
    text-align:center;
    vertical-align:middle;
    border-top:none;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;
    mso-background-source:auto;
    mso-pattern:auto;
    white-space:normal;}
    .xl6911939
    {padding-top:1px;
    padding-right:1px;
    padding-left:1px;
    mso-ignore:padding;
    color:black;
    font-size:11.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;
    mso-number-format:General;
    text-align:center;
    vertical-align:middle;
    border-top:.5pt solid windowtext;
    border-right:none;
    border-bottom:.5pt solid windowtext;
    border-left:none;
    mso-background-source:auto;
    mso-pattern:auto;
    white-space:normal;}
    ruby
    {ruby-align:left;}
    rt
    {color:windowtext;
    font-size:9.0pt;
    font-weight:400;
    font-style:normal;
    text-decoration:none;
    font-family:宋体;
    mso-generic-font-family:auto;
    mso-font-charset:134;
    mso-char-type:none;}

    </style>

    <script src="http://www.cnblogs.com/js/jquery/jquery.js" type="text/javascript"></script>
    <script type="text/javascript">
    writeData(window.opener.msg);

    function writeData(data) {
    var operationType = "PrintData";
    var utilUrl = "ExpelManageUtil.aspx";
    var pdata = "operationType=" + operationType + "&id=" + data;
    $.ajax({
    url: utilUrl, //后台处理类
    type: "POST",
    data: pdata,
    dataType: "json",
    timeout: 1000,
    error: function(data) { alert("出现错误或者您没有权限!"); },
    success: function(data) {
    var b = document.body.innerHTML;
    for (var elem in data) {//遍历data中的每一个属性及属性值
    b = b.replace("$" + elem, data[elem]);
    }
    document.body.innerHTML = b;

    window.print(); //打印本页
    }
    });

    }
    </script>

    </head>

    <body>
    <!--[if !excel]>  <![endif]-->
    <!--下列信息由 Microsoft Office Excel 的“发布为网页”向导生成。-->
    <!--如果同一条目从 Excel 中重新发布,则所有位于 DIV 标记之间的信息均将被替换。-->
    <!--“从 EXCEL 发布网页”向导开始-->

    <div id="环境调查_11939" align=center x:publishsource="Excel">

    <table x:str border=0 cellpadding=0 cellspacing=0 width=871 class="xl6411939"
    style='border-collapse:collapse;table-layout:fixed;655pt'>
    <col class="xl6411939" width=42 style='mso-width-source:userset;mso-width-alt: 1344;32pt'>
    <col class="xl6411939" width=72 style='54pt'>
    <col class="xl6411939" width=42 style='mso-width-source:userset;mso-width-alt: 1344;32pt'>
    <col class="xl6411939" width=60 style='mso-width-source:userset;mso-width-alt: 1920;45pt'>
    <col class="xl6411939" width=64 style='mso-width-source:userset;mso-width-alt: 2048;48pt'>
    <col class="xl6411939" width=72 style='54pt'>
    <col class="xl6411939" width=55 style='mso-width-source:userset;mso-width-alt: 1760;41pt'>
    <col class="xl6411939" width=61 style='mso-width-source:userset;mso-width-alt: 1952;46pt'>
    <col class="xl6411939" width=42 style='mso-width-source:userset;mso-width-alt: 1344;32pt'>
    <col class="xl6411939" width=72 style='54pt'>
    <col class="xl6411939" width=38 style='mso-width-source:userset;mso-width-alt: 1216;29pt'>
    <col class="xl6411939" width=72 style='54pt'>
    <col class="xl6411939" width=96 style='mso-width-source:userset;mso-width-alt: 3072;72pt'>
    <col class="xl6411939" width=83 style='mso-width-source:userset;mso-width-alt: 2656;62pt'>
    <tr height=45 style='mso-height-source:userset;height:33.75pt'>
    <td colspan=14 height=45 class="xl6811939" width=871 style='height:33.75pt;655pt'> 工 作 日 志</td>
    </tr>
    <tr height=35 style='mso-height-source:userset;height:26.25pt'>
    <td height=35 class="xl6311939" width=42 style='height:26.25pt;border-top:none;32pt'>日期</td>
    <td colspan=2 class="xl6611939" width=114 style='border-right:.5pt solid black;border-left:none;86pt'></td>
    <td class="xl6311939" width=60 style='border-top:none;border-left:none;45pt'>星期</td>
    <td class="xl6311939" width=64 style='border-top:none;border-left:none;48pt'></td>
    <td class="xl6311939" width=72 style='border-top:none;border-left:none;54pt'>天气</td>
    <td class="xl6311939" width=55 style='border-top:none;border-left:none;41pt'></td>
    <td class="xl6311939" width=61 style='border-top:none;border-left:none;46pt'>温度(℃)</td>
    <td class="xl6311939" width=42 style='border-top:none;border-left:none;32pt'></td>
    <td class="xl6311939" width=72 style='border-top:none;border-left:none;54pt'>风力风向</td>
    <td class="xl6311939" width=38 style='border-top:none;border-left:none;29pt'></td>
    <td class="xl6311939" width=72 style='border-top:none;border-left:none;54pt'></td>
    <td class="xl6311939" width=96 style='border-top:none;border-left:none;72pt'>值班员</td>
    <td class="xl6311939" width=83 style='border-top:none;border-left:none;62pt'></td>
    </tr>
    <tr height=29 style='mso-height-source:userset;height:21.75pt'>
    <td height=87 class="xl6311939" width=42 style='height:65.25pt;border-top:none;32pt'>参加人数(人)</td>
    <td class="xl6311939" width=72 style='border-top:none;border-left:none;54pt'></td>
    <td class="xl6311939" width=42 style='border-top:none;32pt'>装备器材</td>
    <td colspan=3 class="xl6611939" width=196 style='border-right:.5pt solid black;border-left:none;147pt'>$Devices </td>
    <td class="xl6311939" width=55 style='border-top:none;41pt'>猎枪(支)</td>
    <td class="xl6311939" width=61 style='border-top:none;border-left:none; 46pt'></td>
    <td class="xl6311939" width=42 style='border-top:none;32pt'>进场时间</td>
    <td class="xl6311939" width=72 style='border-top:none;border-left:none; 54pt'></td>
    <td class="xl6311939" width=38 style='border-top:none;29pt'>结束时间</td>
    <td class="xl6311939" width=72 style='border-top:none;border-left:none; 54pt'></td>
    <td class="xl6311939" width=96 style='border-top:none;72pt'>带队干部</td>
    <td class="xl6311939" width=83 style='border-top:none;border-left:none; 62pt'></td>
    </tr>

    <tr height=52 style='mso-height-source:userset;height:39.0pt'>
    <td colspan=2 height=52 class="xl6311939" width=114 style='height:39.0pt;
    86pt'>消耗子弹(发)</td>
    <td colspan=2 class="xl6311939" width=102 style='border-left:none;77pt'></td>
    <td colspan=3 class="xl6311939" width=191 style='border-left:none;143pt'>猎枪消耗子弹(发)</td>
    <td colspan=2 class="xl6311939" width=103 style='border-left:none;78pt'></td>
    <td colspan=2 class="xl6311939" width=110 style='border-left:none;83pt'>其他器材消耗</td>
    <td colspan=3 class="xl6311939" width=168 style='border-left:none;126pt'></td>

    </tr>
    <tr height=31 style='mso-height-source:userset;height:23.25pt'>
    <td colspan=4 height=31 class="xl6311939" width=216 style='height:23.25pt; 163pt'>环境检查情况及发现问题</td>
    <td colspan=3 class="xl6311939" width=191 style='border-left:none;143pt'>处理措施</td>
    <td colspan=2 class="xl6311939" width=103 style='border-left:none;78pt'>工作量</td>
    <td colspan=2 class="xl6311939" width=110 style='border-left:none;83pt'>器材消耗量</td>
    <td class="xl6311939" width=72 style='border-top:none;border-left:none; 54pt'>工时(时)</td>
    <td class="xl6311939" width=96 style='border-top:none;border-left:none; 72pt'>参加人数(人)</td>
    <td class="xl6311939" width=83 style='border-top:none;border-left:none; 62pt'>带队干部</td>
    </tr>
    <tr height=65 style='mso-height-source:userset;height:48.75pt'>
    <td colspan=4 height=65 class="xl6311939" width=216 style='height:48.75pt; 163pt'></td>
    <td colspan=3 class="xl6311939" width=191 style='border-left:none;143pt'></td>
    <td colspan=2 class="xl6311939" width=103 style='border-left:none;78pt'></td>
    <td colspan=2 class="xl6311939" width=110 style='border-left:none;83pt'></td>
    <td class="xl6311939" width=72 style='border-top:none;border-left:none; 54pt'></td>
    <td class="xl6311939" width=96 style='border-top:none;border-left:none; 72pt'></td>
    <td class="xl6311939" width=83 style='border-top:none;border-left:none; 62pt'></td>
    </tr>
    <tr height=95 style='mso-height-source:userset;height:71.25pt'>
    <td colspan=2 height=95 class="xl6311939" width=114 style='height:71.25pt; 86pt'>记<span style='mso-spacerun:yes'> </span>事</td>
    <td colspan=12 class="xl6611939" width=757 style='border-right:.5pt solid black; border-left:none;569pt'></td>
    </tr>
    <tr height=95 style='mso-height-source:userset;height:71.25pt'>
    <td colspan=2 height=95 class="xl6311939" width=114 style='height:71.25pt; 86pt'>待办事项</td>
    <td colspan=12 class="xl6611939" width=757 style='border-right:.5pt solid black; border-left:none;569pt'></td>
    </tr>
    <tr height=35 style='mso-height-source:userset;height:26.25pt'>
    <td colspan=4 height=35 class="xl6511939" width=216 style='height:26.25pt; 163pt'>填表人:</td>
    <td class="xl6411939" width=64 style='48pt'></td>
    <td colspan=4 class="xl6511939" width=230 style='173pt'>交班时间:</td>
    <td class="xl6411939" width=72 style='54pt'></td>
    <td colspan=4 class="xl6511939" width=289 style='217pt'>接班人员:</td>
    </tr>
    <tr height=35 style='mso-height-source:userset;height:26.25pt'>
    <td height=35 class="xl6411939" width=42 style='height:26.25pt;32pt'></td>
    <td class="xl6411939" width=72 style='54pt'></td>
    <td class="xl6411939" width=42 style='32pt'></td>
    <td class="xl6411939" width=60 style='45pt'></td>
    <td class="xl6411939" width=64 style='48pt'></td>
    <td class="xl6411939" width=72 style='54pt'></td>
    <td class="xl6411939" width=55 style='41pt'></td>
    <td class="xl6411939" width=61 style='46pt'></td>
    <td class="xl6411939" width=42 style='32pt'></td>
    <td class="xl6411939" width=72 style='54pt'></td>
    <td class="xl6411939" width=38 style='29pt'></td>
    <td class="xl6411939" width=72 style='54pt'></td>
    <td class="xl6411939" width=96 style='72pt'></td>
    <td class="xl6411939" width=83 style='62pt'></td>
    </tr>
    <tr height=0 style='display:none'>
    <td width=42 style='32pt'></td>
    <td width=72 style='54pt'></td>
    <td width=42 style='32pt'></td>
    <td width=60 style='45pt'></td>
    <td width=64 style='48pt'></td>
    <td width=72 style='54pt'></td>
    <td width=55 style='41pt'></td>
    <td width=61 style='46pt'></td>
    <td width=42 style='32pt'></td>
    <td width=72 style='54pt'></td>
    <td width=38 style='29pt'></td>
    <td width=72 style='54pt'></td>
    <td width=96 style='72pt'></td>
    <td width=83 style='62pt'></td>
    </tr>
    </table>

    </div>


    <!--“从 EXCEL 发布网页”向导结束-->
    </body>

    </html>

  • 相关阅读:
    2021.Jan.11.Mon
    Samba
    nfs
    python数据类型(字典dictionary2)
    python数据类型(字典dictionary1)
    python数据类型(元祖tuple)
    python数据类型(列表List2)
    python数据类型(列表List1)
    python数据类型(字符串String2)
    python数据类型(数字Numbers)
  • 原文地址:https://www.cnblogs.com/jierong12/p/10254229.html
Copyright © 2020-2023  润新知