Hi, see attached html. When I convert this to xlsx, no styles are applied.
I use the following code:
MemoryStream ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(htmlContent));
HTMLLoadOptions options = new HTMLLoadOptions(LoadFormat.Html);
options.SupportDivTag = true;
//Load the Html file through file path while passing the instance of HTMLLoadOptions class
var wb = new Aspose.Cells.Workbook(ms, options);
wb.Worksheets[0].AutoFitRows();
wb.Worksheets[0].AutoFitColumns();
wb.Save(Path.Combine(myDir, “output.xlsx”), SaveFormat.Xlsx);
Hi,
Thanks for your posting and using Aspose.Cells.
Provide your html again, because your html tags have extra spaces which have made them faulty and useless.
For example, your html looks like this and we are unable to open it in Chrome or FireFox.
< style >
</ style >
< table width = "“685"” cellspacing = "“0"” cellpa
< col width = "“92"” style = "
As you can see
< style >
should be
Apologies, my HTML did seem wrong. Let me give it another try.
Sorry for wasting your time.
Hi,
Thanks for your posting and using Aspose.Cells.
It is good to know that you identified the issues in your html and are fixing it. Hopefully, your issue will be resolved after it. Once, you fixed your html, please open it in Microsoft Excel and see how it looks like in Microsoft Excel and then generate excel file from your html via Aspose.Cells and compare results of both. If they match, then it is ok. But if they do not match, then feel free to report it in this forum. We will look into it and fix your issues. Have a good day.