2017-04-20 124 views
0

我使用table2excel jQuery插件將表格導出爲.xls格式 但是當我導出它時,它以.xls格式導出​​,但是當我使用Microsoft Office Excel打開它時, 「無法打開文件」, 然後我打開它使用谷歌驅動器上的谷歌Office 它打開它正確,但使用谷歌Word。我無法將html表格導出爲Excel xls格式

我想在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> 
+0

嘗試打開Excel去 - >文件 - >選項 - >信任中心 - >信任中心設置 - >保護視圖:選中所有複選框並重新啓動excel。 – Khaleel

+0

其作品感謝您 –

+1

把它作爲解決方案,我會爲您檢查 –

回答

2

打開Excel 去: 文件 - >選項 - >信任中心 - >信任中心設置 - >保護的視圖並檢查所有複選框並重新啓動excel。

希望這會有所幫助。