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

Free Support Forum - aspose.com

Inserting HTML table into DocumentBuilder


I have a problem when I insert a HTML table into the DocumentBuilder.

I attached a source.html with the table, the second table row (red) is set to a height of 1px.

When the HTML is inserted into the DocumentBuilder, all rows are just too high.

So what is the correct markup for getting "normal" row heights?

Thanks in advance.

Kind regards,

Lutz Krause

Hi Lutz,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you load your html document into MS Word, you will get the same output. Regarding row height query, please read following documentation link.

Please manually create your expected Word document using Microsoft Word and attach it here for our reference. We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code.

Hi Tahir,

thanks for your response.

I attached a zip file with two templates.

The html file contains the text we inserted into DocumentBuilder.InsertHtml().

The "word from source.doc" is the result from Aspose.Words.

If you compare both files in word, you can see that they do not look quite the same.

Additionally, we do not create the html manually.

Do you have any suggestions?

Thanks in advance and kind regards,


Hi Lutz,

Thanks for your inquiry. I have tested the scenario using latest version of Aspose.Words for .NET 14.8.0 and have not found any issue in output document. Please use Aspose.Words for .NET 14.8.0. I have attached the output document with this post for your kind reference. I have used the following code example to tested your scenario.

I suggest you please open the html document in MS Word and check the output. Aspose.Words mimics the same behaviour of MS Word.

Document doc = new Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertHtml(File.ReadAllText(MyDir + "source.html"), false);

doc.Save(MyDir + "Out.doc");

Hi Tahir,

you are right. And your code snippet showed me the way to the solution.

Thank you very much.

Kind regards,


Hi Lutz,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.