If there is table with default styling, the HTML output does not have the table styling in that.
For you reference, I have attached the 182731.xlsx file containing table with default style.
Following is the codes snippet being used for generating HTML output:
Workbook workbook = new Workbook(“C:/temp/182731.xlsx”);
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions(SaveFormat.HTML);
htmlSaveOptions.setParseHtmlTagInCell(true);
File htmlFile = new File(“C:/temp/182731.html”);
workbook.save(htmlFile.getAbsolutePath(), htmlSaveOptions);
The html output generated out of it does not have any background color in the table cells.
On similar line when I save this as XML using SpreadsheetML2003SaveOptions, then also the background color of cells is lost.
What works:
- If I save this back as XLSX file, the background color is restored.
- If I save it as Web Page from the Excel itself, the style is restored.
Kindly let me know what is the problem or if I missed out something.