javascript - 我无法将 html 表格导出为 Excel xls 格式

标签 javascript jquery html html-table export-to-excel

我正在使用 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/

相关文章:

javascript - Materialise CSS 选择下拉菜单

php - 从所选复选框的数据库中选择全部

javascript - 如何使用 Ajax 调用在 MVC 中的返回 View 方法中返回 JSON 数据

javascript - 对话框打开之前的 JQuery UI

javascript - 如何设置间隔、清除间隔、使用相同的 ID 重置间隔

javascript - 如何向用户隐藏 JavaScript 变量?

javascript - 从 Struts2 Action 类调用 Javascript

javascript - 使用 javascript 列出 tar 文件的内容

javascript - 获取没有输入标签的 Td 内部 html - Jquery

javascript - 目前是否可以在移动设备上使用全屏(自动播放)视频背景?