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

Free Support Forum - aspose.com

Extra align attribute in HTML output

I am using Aspose 8.1.0

When I try to get the HTML output of certain range containing only numbers but have varied alignments applied, the HTML output from Aspose always add attribute align=right to the td elements irrespective of the alignemnt applied in the source xsl file. However, the html generated from MS Excel does not add this attribute.

For example:
Center Aligned
<td class=x23 align=right>333
<td class=x23 align=right>333

For your reference I have attached the source xsl, Aspose generated html and MS Excel generated html.

Following is the the code snippet being used to generate the HTMl is:
Workbook workbook = new Workbook(“C:/AlignTest.xlsx”);
com.aspose.cells.Worksheet selectedWorksheet = workbook.getWorksheets().get(“Sheet1”);

Range sourceRange = selectedWorksheet.getCells().createRange(“A1:C2”);

Workbook targetWorkbook = new Workbook(FileFormatType.XLSX);
WorksheetCollection targetWsc = targetWorkbook.getWorksheets();
com.aspose.cells.Worksheet targetWs = (com.aspose.cells.Worksheet)targetWsc.get(0);
Range targetRange = targetWs.getCells().createRange(0, 0, sourceRange.getRowCount(), sourceRange.getColumnCount());

PasteOptions options = new PasteOptions();

targetRange.copy(sourceRange, options);

File htmlFile = new File(“C:/AposeGenerated.htm”);
targetWorkbook.save(htmlFile.getAbsolutePath(), SaveFormat.HTML);


Hi Neeraj,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after executing your code with your excel file using the latest version: Aspose.Cells for Java 8.2.0.

We have logged this issue in our database for investigation. We will look into it and see if this issue could be fixed. Once, there is some fix or other update for you, we will let you know asap.

This issue has been logged as CELLSJAVA-40959.


Thanks for using Aspose.Cells for Java.

Please download and try this fix: Aspose.Cells for Java v8.2.0.2 and let us know your feedback.

The issues you have found earlier (filed as CELLSJAVA-40959) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Thanks. I have verified the given issue. It works fine in Aspose Cells 8.3.0.



Thanks for your feedback.

Good to know that your issue is sorted out by the new fix/version. Feel free to write back if you have further comments or questions, we will be happy to assist you soon.

Thank you