需要的插件 jquerybootstrap table/ tableExport.jquery.plugin.js 插件
//html代码
<div class="col-md-12" style="height: 0;overflow: hidden;">
<table id="rateTrackExcel" class="table table-striped table-hover table-responsive"></table>
</div>
$('#rateTrackExcel').tableExport({ type: 'excel', escape: 'false'},''测试文件'); //jquery中,页面元素 name 实际导出excel的文件名称
//导出需要的代码:tableExport.jquery.plugin.js
//在相应代码中,需要修改
$.fn.tableExport = function (options,fileName) {
fileName: fileName == undefined?'tableExport':fileName, //fileName 是上面的name参数,此处使用3元运算符,有name参数则
//显示,没有文件名就显示tableExport.xls
}
结果: