Table Cell Formatting is lost after HTML to PDF Conversion using .NET

The following code:

<p>Table 1:</p><figure class="table"><table style="border-bottom:10px solid hsl(120, 75%, 60%);border-left:10px solid hsl(120, 75%, 60%);border-right:10px solid hsl(120, 75%, 60%);border-top:10px solid hsl(120, 75%, 60%);"><tbody><tr><td style="background-color:hsl(60, 75%, 60%);text-align:center;">A1</td><td style="background-color:hsl(90, 75%, 60%);text-align:center;">B1</td></tr><tr><td style="background-color:hsl(30, 75%, 60%);text-align:center;">A2</td><td style="background-color:hsl(210, 75%, 60%);text-align:center;">B2</td></tr></tbody></table></figure>

In this code:

private static void GenerateFinalFile(string convertedHTML, string fileName, SaveFormat saveFormat)
{
    Aspose.Words.Document finalDoc = new Aspose.Words.Document();
    DocumentBuilder documentBuilder = new DocumentBuilder(finalDoc);
    documentBuilder.InsertHtml(convertedHTML);

    using (var docStream = new FileStream(string.Format(fileName, saveFormat), FileMode.OpenOrCreate))
    {
        finalDoc.Save(docStream, saveFormat);
    }
}

Loses all the table formatting, irrespective of the target file type (docx, pdf, gif, etc). There was a problem with v17 reported some time ago that was allegedly fixed, however I am using the latest version (I had the same problem on v20 also).

Setting useBuilderFormatting to either true or false makes no difference. Anyone able to assist me please?

@jamescorvid

We have tested the scenario using the latest version of Aspose.Words for .NET 21.4 and have not found the shared issue. So, please use Aspose.Words for .NET 21.4.

Moreover, please note that Aspose.Words mimics the behavior of MS Word. If you open the same HTML in MS Word and convert it to DOCX or PDF, you will get the same output.

Thank you for the swift reply! I can confirm that if I open the html in Word that Word itself removes the formatting around the table!