Different HTML SaveOptions leads to different table heigth

Hi,

when I use following code snippets to save docx to html,
the table heights are different as you can see with the black line next to the table.

This is my code:

Document docBR = new Document(@"TableHeigth.docx");
Aspose.Words.Saving.HtmlSaveOptions saveop2 = new Aspose.Words.Saving.HtmlSaveOptions();
docBR.Save("html/outputHtmlSaveOptions.html", saveop2);

//docBR.JoinRunsWithSameFormatting();
//Encoding encoding = new UTF8Encoding(true);


string cssPrefix2 = "dm";
HtmlFixedSaveOptions saveOptionsFixed2 = new HtmlFixedSaveOptions();

saveOptionsFixed2.CssClassNamesPrefix = cssPrefix2;

saveOptionsFixed2.ExportEmbeddedFonts = false;
saveOptionsFixed2.ExportEmbeddedImages = false;
saveOptionsFixed2.ExportEmbeddedSvg = false;
saveOptionsFixed2.FontFormat = ExportFontFormat.Ttf;


saveOptionsFixed2.PrettyFormat = true;

saveOptionsFixed2.ExportEmbeddedCss = true;
docBR.Save("html/outputHtmlFixedSaveOptions.html", saveOptionsFixed2);

This is the result: resulthtml.zip (80.1 KB)
With HtmlFixedSaveOptions it looks like in Word.

Why are the heigths of the table different ? And what do I have to consider so that the table heights are the same?

Kind regards,
@Nachti

@Nachti When you save the document with HtmlFixedSaveOptions the document is rendered and look the same as it look if you save it to PDF or XPS using Aspose.Words. HtmlFixed format is good for viewing document, but it does not preserve original internal document structure and cannot be converted back to DOCX.
When you save the document with HtmlSaveOptions, the document is saved as regular flow HTML and it’s appearance depends on the browser rendering engine. There is no guaranty the document will look exactly the same in browser as it looks in MS Word. You will get a similar result if save the document to HTML using MS Word.

Hi @alexey.noskov,

thanks for the quick response. But may be you can give an expertise why the table height is different.

Kind regards,
@Nachti

@Nachti In your source document rows heights in the table uses At Least height rule. i.e. row height can vary depending on the content:

The same occurs in HTML:

<tr style="height:8.5pt">

But if content does not fit the specified height, table row height is stretched. That might cause difference in table height.