If you wonder how hard it is to generate an excel or csv in javascript, stop wonder. It is very easy and you don't even have to use a framework to do it. But if you prefer to have a powerful customization, then yes, go for a framework.
Below are the step on how to do it.
(Note that, it will come out as plain excel and csv file. This will be useful when you only need the data inside the excel or csv file for import purpose).
For Chrome:
Javascript
* For those who are using Mozilla Firefox, you may consider to use the method below.
(The above method not working well in my Mozilla Firefox)
For Mozilla Firefox:
HTML (Create an onlick button)
3 comments
Hi, I want to ask how to export as xlsx file instead of csv file?
Just changed the .csv of this line `excel_file.setAttribute('download', 'Visitor_History.csv')` to .xls
Done!
EmoticonEmoticon