I am converting excel from html using aspose cells library 25.12 version and java version 21
but rowspan is not applying in excel
This is html and my java code for converting
Data+ Hong Kong SAR Counterparty Codes
// Create Aspose HTML Load Options
final HtmlLoadOptions loadOptions = new HtmlLoadOptions(LoadFormat.HTML);
// Configure load options for better HTML rendering
loadOptions.setSupportDivTag(false); // Disable DIV support to avoid extra rows
loadOptions.setAutoFitColsAndRows(true);
final Workbook workbook = new Workbook(tempHtmlFile.getAbsolutePath(), loadOptions);
You are using Aspose.Cells for Java 25.12 to convert an HTML file containing a table with a rowspan attribute into Excel, but the rowspan formatting is not being preserved in the output .
A similar issue involving loss of HTML table structure during conversion to Excel was previously reported and acknowledged by Aspose support. The issue was logged under ticket ID CELLSNET-50985, where it was confirmed that table formatting is not correctly retained when loading HTML into a Workbook and saving as Excel .
While your version (25.12) includes fixes for other issues (e.g., CELLSJAVA-46573) , there is no evidence in the provided context that the rowspan-related problem has been addressed in this release.
Based on the available information, this behavior may indicate that CELLSNET-50985 or a similar rowspan-specific bug remains unresolved in Aspose.Cells for Java 25.12, particularly affecting structural HTML table attributes like rowspan .
Ensure your HTML is well-formed and consider testing with minimal samples to isolate the behavior. We will follow up in this thread once more information is available or if a workaround becomes applicable.
I simply created the HTML file (attached in the zipped archive) based on your HTML script and used the following sample code to load the HTNL file and then save the Excel file. I found no issue when comparing the output Excel file in MS Excel (attached).
e.g., Sample code:
// Create Aspose HTML Load Options
final HtmlLoadOptions loadOptions = new HtmlLoadOptions(LoadFormat.HTML);
// Configure load options for better HTML rendering
loadOptions.setSupportDivTag(false); // Disable DIV support to avoid extra rows
loadOptions.setAutoFitColsAndRows(true);
final Workbook workbook = new Workbook("d:\\files\\Bk_test1.html", loadOptions);
workbook.save("d:\\files\\out1.xlsx", SaveFormat.XLSX);
Please find attached the zipped archive containing the input HTML file and output Excel file. Please check if you find any issue with the output Excel file when comparing it with input HTML string, please elaborate with details. files1.zip (6.3 KB)
@dhrumil.bhalala
Please check dest (2).zip (6.3 KB)
which is generated with the following codes and Aspose.Cells 25.12:
// Create Aspose HTML Load Options
final HtmlLoadOptions loadOptions = new HtmlLoadOptions(LoadFormat.HTML);
// Configure load options for better HTML rendering
loadOptions.setSupportDivTag(false); // Disable DIV support to avoid extra rows
loadOptions.setAutoFitColsAndRows(true);
final Workbook workbook = new Workbook(dir +"a.html", loadOptions);
workbook.saves(dir +"dest.xlsx");
I have tested your scenario/case using your HTML scripts (I created a file from the scripts). I found the issue as you have mentioned. I found Excel displays 3 rows space for the input HTML where as Aspose.Cells renders 2 rows space in the output Excel file.
e.g., Sample code:
// Create Aspose HTML Load Options
final HtmlLoadOptions loadOptions = new HtmlLoadOptions(LoadFormat.HTML);
// Configure load options for better HTML rendering
loadOptions.setSupportDivTag(false); // Disable DIV support to avoid extra rows
loadOptions.setAutoFitColsAndRows(true);
final Workbook workbook = new Workbook("d:\\files\\Bk_test1.html", loadOptions);
workbook.save("d:\\files\\out12.xlsx", SaveFormat.XLSX);
Please find attached the zipped archive containing both input and output files. files1.zip (6.9 KB)
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in support policies.
Issue ID(s): CELLSJAVA-46612
You can obtain paid support services if you need support on a priority basis, along with the direct access to our Paid Support management team.