实现办法下载jquery的excel导出插件点击打开链接,此插件需要base64编码,所以在引用的时候也需要在引用64位编码的js脚本,例如
<script src="jquery-1.10.2.js"></script>
<script src="tableExport.js"></script>
<script src="jquery.base64.js"></script>
使用方法:
<button type="button" οnclick="$('#tb_doc_m').tableExport({ type: 'excel', separator: ';', escape: 'false' });" class="btn btn-default">
<i class="glyphicon glyphicon-search">导出Excel</i>
</button>
<table class="table" id="tb_doc_m">
.....
</table>
如果要导出表头需要设置完整的table,如thread,tbody等标准的html5表格。
额外注意:由于下载的脚本无法解决中文导出问题所以需要修改base64编码的js脚本,以及在tableexport使用base64编码脚本的部分。
已经修改完成的脚本如下: