On which version of aspose lib you testing on , can you please share version details
@abdulkadirsabirbohari I have tested with 23.2 version of Aspose.Words for .NET (the latest version on the time of testing).
Currently the latest version is 23.3
https://www.nuget.org/packages/Aspose.Words
please check that output properly , issue is der , the column width not applied to the table.
@abdulkadirsabirbohari Aspose.Words output is similar to MS Word output. The following code:
Document doc = new Document(@"C:\Temp\in.html");
doc.Save(@"C:\Temp\out.docx");
Produces the following output on my side: out.docx (7.4 KB)
If convert your HTML to DOCX document using MS Word output is the following: ms.docx (12.4 KB)
As you can see the outputs are almost the same. I use MS Word 2019 to open and compare the documents.
How can we check if table has particular class .
class name : col-auto-fit , added to the table that we want to identify.
foreach (Table t in WordDocument.GetChildNodes(NodeType.Table, true))
{
if (t.GetText().Contains("col-auto-fit"))
{
t.AutoFit(AutoFitBehavior.FixedColumnWidths);
}
}
@abdulkadirsabirbohari Unfortunately, there is no way to check whether table has a particular CSS class after loading HTML document into Aspose.Words DOM. Please note, Aspose.Words is designed to work with MS Word documents. HTML documents and MS Word documents object models are quite different and it is not always possible to provide 100% fidelity after conversion one format to another.