如何在将html表导出到xls文件时设置分隔符,以便在使用openOffice calc打开文件时不会单独要求分隔符

How to set delimiter while exporting html table to xls file, so that it won't ask for delimiter separately when opening file with openOffice calc?

本文关键字:文件 分隔符 calc openOffice 单独 html xls 设置      更新时间:2023-09-26

生成xml文件的Javascript代码

// string to be obtained in xls file in different columns
var exportString = 'Source1; 240; A/V Signal drop out; 15';  
// creating anchor tag
var a = document.createElement('a');
    a.href = 'data:attachment/xls,' + exportString;
    a.target = '_blank';
    a.download = 'filename.xls';
    document.body.appendChild(a);
    a.click();

您可能有不同的分隔符,所以您可能没有做错任何事情,开放式办公室只需要知道应该使用什么分隔符