最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Excel file generated by table2excel jQuery plugin throws error when opened - Stack Overflow

programmeradmin1浏览0评论

I have a HTML table that I want to export to Excel using the table2excel plugin. Unfortunately when I download it, the generated Excel file has an error. How can I fix that?

I have created a JSFiddle.

Basically to call the plugin you just need to do this:

$("#downloadIntermidiate").click(function(){

                        $("#intermediateTable").table2excel({
                              exclude: ".noExl",
                        name: "Excel Document intermediateTable"
                        }); 

                         });

Here #intermediateTable is the id of the table that has to be printed.

I have a HTML table that I want to export to Excel using the table2excel plugin. Unfortunately when I download it, the generated Excel file has an error. How can I fix that?

I have created a JSFiddle.

Basically to call the plugin you just need to do this:

$("#downloadIntermidiate").click(function(){

                        $("#intermediateTable").table2excel({
                              exclude: ".noExl",
                        name: "Excel Document intermediateTable"
                        }); 

                         });

Here #intermediateTable is the id of the table that has to be printed.

Share Improve this question edited Oct 9, 2015 at 7:04 Anders 8,65310 gold badges60 silver badges99 bronze badges asked Oct 9, 2015 at 6:50 Vikram Anand BhushanVikram Anand Bhushan 4,89615 gold badges74 silver badges133 bronze badges 1
  • 1 If I change the file name from .xlsx to .xls I get a warning message, but the file opens and looks OK. – Anders Commented Oct 9, 2015 at 7:01
Add a ment  | 

1 Answer 1

Reset to default 4

You fiddle works Fine, Just Changed .xlsx to .xls , it exports

function getFileName(settings) {
    return ( settings.filename ? settings.filename : "table2excel") + ".xls";
 }

Check this fiddle-> https://jsfiddle/t8tegrad/8/

发布评论

评论列表(0)

  1. 暂无评论