天天看點

十七 bootstrap-table tableExport 導出xlsx格式表格

在[十六、bootstrap-table javascript導出資料]中,打開導出的表格時,總會彈出一個提示窗

十七 bootstrap-table tableExport 導出xlsx格式表格

那麼,導出xlsx格式的應該就沒問題了吧?!實驗如下,查找tableExport.js資料

TableExport插件依賴于jQuery(1.2.1+),FileSaver.js。為了支援.xlsx(Office Open XML SpreadsheetML Format)格式,你必須在 FileSaver.js 和 TableExport.js檔案之前引入xlsx-core.js檔案。為了使舊的浏覽器(Firefox < 20, Opera < 15, Safari < 6)支援.xlsx,需要在 FileSaver.js 檔案之前引入 Blob.js檔案。
十七 bootstrap-table tableExport 導出xlsx格式表格

2.在html中添加:

<code>&lt;script type="text/javascript" src="/static/js/xlsx.full.min.js"&gt;&lt;/script&gt;</code>

3.js中修改:

4.導出效果

十七 bootstrap-table tableExport 導出xlsx格式表格
十七 bootstrap-table tableExport 導出xlsx格式表格

參考文檔:

繼續閱讀