How to export HTML tables to a single excel workbook with different sheets?


You can create an Excel workbook with multiple sheets and retain formatting (including colspan and rowspan) using SheetJS. Here is a discussion thread and examples posted in that thread:

1) Workbook with Multiple Sheets

Library: https://github.com/SheetJS/js-xlsx
Discussion: https://github.com/SheetJS/js-xlsx/issues/664
Demo (Click Excel link): https://jsfiddle.net/97ajn9wm/1/ (by reviewher)