Styling Issues When Generating an Xls From HTML
A few notes to self on generating .xls files from HTML tables, particularly with CSS.
It appears that excel only has a particular ‘range’ of hex numbers you can use (at least for background colours). I was trying to use #eeeeee; for a while (which is obviously fine for HTML and for creating a PDF), but I couldn’t use that as a value in excel as the colours just weren’t displaying. Perhaps the colour was too close to white?
In any event, once I chose a darker colour (#bbbbbb) the background colour appeared fine!
Another issue was that HTML allows you to specifiy multiple CSS classes such as:
1 2 3 4
This wasn’t working for me, so for that
1 2 3 4
If anyone is interested in the code to actually launch the open/save dialogue window, here it is:
1 2 3