//引入包
<script src="/FileSaver.js"></script>
<script src="/jquery.wordexport.js"></script>
<button class="layui-btn" lay-filter="save1" id="export">导出文件</button>
<div style="margin: 0 auto;" id="exportdiv" class="Section1">
<div style="margin: 0 auto; 800px;">
<h1>XXXXXX</h1>
</div>
<div class="layui-form" style="margin: 0 auto; 100%;">
<h2>填表单位盖章:</h2>
<table id="msgtable" class="gridtable" style=" 98%">
<tr style="font-size: 20px" >
<th colspan="5" rowspan="2" style=" 400px">区域</th>
<th colspan="1" rowspan="3" style="height: 100px; 200px">大幅度发</th>
<th colspan="5" rowspan="1" style=" 600px">大幅度发</th>
</tr>
<tr>
<th rowspan="2">种植VBVB</th>
<th rowspan="2">风格风格的</th>
<th rowspan="2">发鬼地方</th>
<th rowspan="2">发的过程</th>
<th rowspan="2">同仁堂</th>
</tr>
<tr>
</tr>
</table>
<ul id="textmsg">
<li style="margin-left: 0px"><h2>填表人:</h2></li>
<li><h2>联系方式:</h2></li>
<li><h2>填表时间:</h2></li>
</ul>
</div>
</div>
//js 代码
$("#export").off().on("click", function() {
$("#exportdiv").wordExport();
})