I need to export an HTML table to an Excel file locally in the browser. It is crucial that special characters (e.g., ä, ö, ü, ß, etc.) are correctly preserved in the exported file.
Key requirements:
The export must happen locally in the browser (no server-side processing).
Special characters must be properly encoded and displayed in Excel.
Does anyone have recommendations or a reliable example of how to achieve this?
Bonus:
If possible, I would appreciate a solution that doesn’t require additional dependencies, but I am open to using a library if it simplifies the process.
I have explored some solutions that use libraries like SheetJS (xlsx) or plain JavaScript methods (e.g., Blob), but I am unsure of the best approach to ensure compatibility and proper encoding (e.g., UTF-8 or other relevant encodings)
Lyla is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.