我正在使用 table2excel jQuery 插件将表导出为 .xls 格式 但是当我导出它时,它以 .xls 格式导出,但是当我使用 Microsoft Office Excel 打开它时,它给出“无法打开文件”, 然后我使用 Google Drive 上的 Google Office 打开它 它可以正确打开它,但使用的是 Google Word。
我想在 Office Excel 上打开该文件。 这是我的代码:
$('#excel').click(function(){
$("#tables").table2excel({
exclude: ".table",
name: "Worksheet Name",
filename: "Rapor",
fileext: ".xls",
exclude_img: true,
exclude_links: true,
exclude_inputs: true
});
});
<table class="table" id="tables">
<thead class="thead-inverse">
<tr>
<th>Mağaza Adı</th>
<th>ID No</th>
<th>Ariza Sınıfı</th>
<th>İş Tipi</th>
<th>Tarih</th>
<th>Malzeme Kodu</th>
<th>Malzeme Adi</th>
<th>Miktar</th>
<th>Birim</th>
<th>Fiyat</th>
<th>Toplam Fiyat</th>
</tr>
</thead>
</table>
最佳答案
打开Excel 去: 文件 -> 选项 -> 信任中心 -> 信任中心设置 -> protected View 并选中所有复选框并重新启动 Excel。
希望这有帮助。
关于javascript - 我无法将 html 表格导出为 Excel xls 格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43511689/