1、准备要打印的excel
2、将其另存为html文件
3、截取html文件源代码
<style>
tr
{mso-height-source:auto;
mso-ruby-visibility:none;}
col
{mso-width-source:auto;
mso-ruby-visibility:none;}
br
{mso-data-placement:same-cell;}
ruby
{ruby-align:left;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:middle;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:12.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:宋体;
mso-generic-font-family:auto;
mso-font-charset:134;
border:none;
mso-style-name:常规;
mso-style-id:0;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size:12.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:general;
vertical-align:middle;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate:0;}
.xl65
{mso-style-parent:style0;
text-align:center;}
.xl66
{mso-style-parent:style0;
text-align:center;
border:.5pt solid windowtext;}
.xl67
{mso-style-parent:style0;
border:.5pt solid windowtext;}
.xl68
{mso-style-parent:style0;
font-size:14.0pt;
font-family:方正仿宋_GBK;
mso-generic-font-family:auto;
mso-font-charset:134;
mso-number-format:"\@";
text-align:center;
border:.5pt solid windowtext;
background:#D8D8D8;
mso-pattern:black none;}
.xl69
{mso-style-parent:style0;
color:black;
font-size:14.0pt;
font-family:方正仿宋_GBK;
mso-generic-font-family:auto;
mso-font-charset:134;
text-align:center;
border:.5pt solid windowtext;
background:#D8D8D8;
mso-pattern:black none;
white-space:normal;}
.xl70
{mso-style-parent:style0;
border:.5pt solid windowtext;
background:#D8D8D8;
mso-pattern:black none;}
.xl71
{mso-style-parent:style0;
text-align:center;
border:.5pt solid windowtext;
background:#D8D8D8;
mso-pattern:black none;}
.xl72
{mso-style-parent:style0;
mso-number-format:"yyyy\0022年\0022m\0022月\0022";
border:.5pt solid windowtext;}
.xl73
{mso-style-parent:style0;
font-weight:700;
mso-number-format:"yyyy\0022年\0022m\0022月\0022";
border:.5pt solid windowtext;}
.xl74
{mso-style-parent:style0;
border:.5pt solid windowtext;
white-space:normal;}
.xl75
{mso-style-parent:style0;
font-weight:700;
vertical-align:bottom;}
.xl76
{mso-style-parent:style0;
mso-number-format:"\@";
text-align:center;
border:.5pt solid windowtext;}
.xl77
{mso-style-parent:style0;
text-align:center;
border:.5pt solid windowtext;
white-space:normal;}
.xl78
{mso-style-parent:style0;
font-weight:700;
border:.5pt solid windowtext;}
.xl79
{mso-style-parent:style0;
font-size:16.0pt;
font-weight:700;
text-align:center;
border-top:none;
border-right:none;
border-bottom:.5pt solid windowtext;
border-left:none;}
</style>
<table border=0 cellpadding=0 cellspacing=0 width=1020 style='border-collapse:
collapse;table-layout:fixed;width:766pt'>
<col width=40 style='mso-width-source:userset;mso-width-alt:1280;width:30pt'>
<col width=106 style='mso-width-source:userset;mso-width-alt:3392;width:80pt'>
<col width=67 style='mso-width-source:userset;mso-width-alt:2144;width:50pt'>
<col width=94 style='mso-width-source:userset;mso-width-alt:3008;width:71pt'>
<col width=44 style='mso-width-source:userset;mso-width-alt:1408;width:33pt'>
<col width=62 style='mso-width-source:userset;mso-width-alt:1984;width:47pt'>
<col width=99 style='mso-width-source:userset;mso-width-alt:3168;width:74pt'>
<col width=235 style='mso-width-source:userset;mso-width-alt:7520;width:176pt'>
<col width=161 style='mso-width-source:userset;mso-width-alt:5152;width:121pt'>
<col width=112 style='mso-width-source:userset;mso-width-alt:3584;width:84pt'>
<col width=404 style='mso-width-source:userset;mso-width-alt:12928;width:303pt'>
<tr height=50 style='mso-height-source:userset;height:37.7pt'>
<td colspan=8 height=50 class=xl79 width=747 style='height:37.7pt;width:561pt'>****年**月表</td>
<td width=161 style='width:121pt'></td>
<td width=112 style='width:84pt'></td>
</tr>
<tr class=xl65 height=44 style='mso-height-source:userset;height:33.0pt'>
<td height=44 class=xl66 style='height:33.0pt;border-top:none'>序号</td>
<td class=xl76 style='border-top:none;border-left:none'>a</td>
<td class=xl76 style='border-top:none;border-left:none'>b</td>
<td class=xl66 style='border-top:none;border-left:none'>c</td>
<td class=xl77 width=44 style='border-top:none;border-left:none;width:33pt'>d</td>
<td class=xl77 width=62 style='border-top:none;border-left:none;width:47pt'>e</td>
<td class=xl66 style='border-top:none;border-left:none'>f</td>
<td class=xl77 width=235 style='border-top:none;border-left:none;width:176pt'>g</td>
<td class=xl65><span style='mso-spacerun:yes'> </span></td>
<td class=xl65><span style='mso-spacerun:yes'> </span></td>
</tr>
<tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'>
<td colspan=8 height=28 class=xl78 style='height:21.0pt'>一、a类人员</td>
<td class=xl65><span style='mso-spacerun:yes'> </span></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'>
<td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>1</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl72 style='border-top:none;border-left:none'> </td>
<td class=xl67 style='border-top:none;border-left:none'> </td>
<td class=xl65><span style='mso-spacerun:yes'> </span></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'>
<td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>2</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl72 style='border-top:none;border-left:none'> </td>
<td class=xl67 style='border-top:none;border-left:none'> </td>
<td class=xl65><span style='mso-spacerun:yes'> </span></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'>
<td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>3</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl72 style='border-top:none;border-left:none'> </td>
<td class=xl67 style='border-top:none;border-left:none'> </td>
<td class=xl65><span style='mso-spacerun:yes'> </span></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'>
<td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>4</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl72 style='border-top:none;border-left:none'> </td>
<td class=xl67 style='border-top:none;border-left:none'> </td>
<td class=xl65></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'>
<td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>5</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl72 style='border-top:none;border-left:none'> </td>
<td class=xl67 style='border-top:none;border-left:none'> </td>
<td class=xl65></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'>
<td colspan=8 height=28 class=xl78 style='height:21.0pt'>二、b类人员</td>
<td class=xl65></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=32 style='mso-height-source:userset;height:24.0pt'>
<td height=32 class=xl67 align=right style='height:24.0pt;border-top:none'>1</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl72 style='border-top:none;border-left:none'> </td>
<td class=xl67 style='border-top:none;border-left:none'> </td>
<td class=xl65></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=34 style='mso-height-source:userset;height:25.7pt'>
<td height=34 class=xl67 align=right style='height:25.7pt;border-top:none'>2</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl73 style='border-top:none;border-left:none'> </td>
<td class=xl74 width=235 style='border-top:none;border-left:none;width:176pt'> </td>
<td class=xl65></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=36 style='mso-height-source:userset;height:27.0pt'>
<td height=36 class=xl67 align=right style='height:27.0pt;border-top:none'>3</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl73 style='border-top:none;border-left:none'> </td>
<td class=xl74 width=235 style='border-top:none;border-left:none;width:176pt'> </td>
<td class=xl65></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=36 style='mso-height-source:userset;height:27.0pt'>
<td height=36 class=xl67 align=right style='height:27.0pt;border-top:none'>4</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl69 width=67 style='border-top:none;border-left:none;width:50pt'> </td>
<td class=xl69 width=94 style='border-top:none;border-left:none;width:71pt'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl73 style='border-top:none;border-left:none'> </td>
<td class=xl74 width=235 style='border-top:none;border-left:none;width:176pt'> </td>
<td class=xl65></td>
<td class=xl65></td>
</tr>
<tr class=xl65 height=28 style='mso-height-source:userset;height:21.0pt'>
<td height=28 class=xl67 align=right style='height:21.0pt;border-top:none'>5</td>
<td class=xl68 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl70 style='border-top:none;border-left:none'> </td>
<td class=xl71 style='border-top:none;border-left:none'> </td>
<td class=xl73 style='border-top:none;border-left:none'> </td>
<td class=xl74 width=235 style='border-top:none;border-left:none;width:176pt'> </td>
<td class=xl65></td>
<td class=xl65></td>
</tr>
<tr height=49 style='mso-height-source:userset;height:36.75pt'>
<td height=49 class=xl75 colspan=2 style='height:36.75pt;mso-ignore:colspan'>填表人:<span
style='mso-spacerun:yes'> </span></td>
<td class=xl75></td>
<td class=xl75>复核:<span style='mso-spacerun:yes'> </span></td>
<td class=xl75></td>
<td class=xl75></td>
<td class=xl75 colspan=2 style='mso-ignore:colspan'>领导审核:<span
style='mso-spacerun:yes'> </span></td>
<td></td>
<td></td>
</tr>
<![if supportMisalignedColumns]>
<tr height=0 style='display:none'>
<td width=40 style='width:30pt'></td>
<td width=106 style='width:80pt'></td>
<td width=67 style='width:50pt'></td>
<td width=94 style='width:71pt'></td>
<td width=44 style='width:33pt'></td>
<td width=62 style='width:47pt'></td>
<td width=99 style='width:74pt'></td>
<td width=235 style='width:176pt'></td>
<td width=161 style='width:121pt'></td>
<td width=112 style='width:84pt'></td>
</tr>
<![endif]>
</table>
4、将截取到的代码用于打印
该方法省去了手动画表格的步骤