简体   繁体   English

如何将JavaScript中的数组导出到IE11上的CSV或Excel文件中?

[英]How can I export my Arrays in JavaScript into a CSV or Excel file on IE11?

Assuming I have a 2D array named Data. 假设我有一个名为Data的2D数组。

I need to use IE11 for this job. 我需要为此工作使用IE11。

您可以使用此库来创建文件: https : //github.com/eligrey/FileSaver.js/

  • convert the array to the required cvs format as a string 将字符串转换为所需的cvs格式的字符串
  • convert the string to a blob 将字符串转换为Blob
  • save the blob navigator.msSaveOrOpenBlob(blob, 'file.cvs'); 保存blob navigator.msSaveOrOpenBlob(blob, 'file.cvs');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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