简体   繁体   中英

I can't export html table to Excel xls format

I'm using table2excel jQuery plugin to export table to .xls format but when I export it it exports in .xls but when I open it using Microsoft Office Excel its gives "can't open the file", then I open it using Google Office on Google Drive it opens it correctly but using Google Word.

I want to open the file on Office Excel. This is my code:

$('#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>

Open Excel go to: file -> options -> trust center -> trust center settings -> protected view and check all checkboxes and restart excel.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM