We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Default table style not honored in HTML or XML output

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.

Hi,


Thanks for providing us template file and sample code.

After an initial test, I observed the issue as you mentioned by converting your template Excel file to HTML, the default table style is not honored in the output HTML/ XML file. When I saved the file as HTML/ Web page manually in MS Excel, the table style is retained.
e.g
Sample code:

Workbook workbook = new Workbook(“182731.xlsx”);
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions(SaveFormat.HTML);
htmlSaveOptions.setParseHtmlTagInCell(true);
File htmlFile = new File(“f:/files/out1827311.html”);
workbook.save(htmlFile.getAbsolutePath(), htmlSaveOptions);

I have logged a ticket with an id “CELLSJAVA-40937” for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Hi,


The issue seems to be fixed in Aspose Cells 8.3.0 for Java.

Kindly check and close it.

Thanks,
Neeraj

Hi,


Thanks for your feedback.

Well, I tested your issue with our latest version/fix: Aspose.Cells for Java (Latest Version) and it fixes the issue. As we have enhanced HTML renderings in newer versions, so the issue might be fixed in it automatically. You may either keep using v8.3.0 or use v8.3.1.2 which fixes the issue.

And, I have closed your ticket now.

Thank you.