How can I export a table generated using Knockout that will maintain the formatting?
I was using this solution (How to export html table to excel using javascript), but it does not include formatting.
How can I export a table generated using Knockout that will maintain the formatting?
I was using this solution (How to export html table to excel using javascript), but it does not include formatting.
As I mentioned in my comment, excelbuilderjs.com might work out for you. There are a couple of distinct downsides - one in that you can't simply turn an HTML table into an excel spreadsheet with colors and etc. It does require setup. But, in the case of where I work, we have a fairly standard color scheme and set of formatters that has been translated into a standalone set of instructions that is then included everywhere we need to construct a spreadsheet.
Based on a few simple examples of Knockout, you could probably just use the same data source to loop through and assign to EB - then just assign number formatting and date formatting as you would for an actual excel spreadsheet (i.e. $#,##0.00 for basic currency, m/d/yyyy for a basic date).
Side note - apparently some of my documentation didn't make it up. http://excelbuilderjs.com/cookbook/formatting.html is where you can get some basic info on formatting.