Encoding UTF-8 when exporting HTML table to Excel

前端 未结 5 947
感动是毒
感动是毒 2020-12-01 09:39

I am trying to export an HTML table to Excel using javascript. This is the javascript code



        
5条回答
  •  佛祖请我去吃肉
    2020-12-01 10:18

    if you want to change default file name according to @Axel Richter's answer, try this:

    var link = document.createElement('a');
    link.download = 'filename.xls';
    ...
    link.href = uri + base64(format(template, ctx));
    link.click();
    ...
    

    replace window.location.href with link.href

提交回复
热议问题