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

Free Support Forum - aspose.com

HTML Table with CSS border color converting as black-border, and margin not coming through

When importing an HTML document with a very simple table with one row/column in it that has a specific color in the CSS, using Aspose to create the Word Document for this - we always end up with a border color of black and the margins are not being added to the top of the tables.

Aspose.Words version: 21.4.0

Table HTML:
table with class=“my-border”

<table class="my-border">
  <tr><td>In standard color</td></tr>
</table>

table with class=“my-border my-border-red”

<table class="my-border my-border-red">
  <tr><td>In red</td></tr>
</table>

table with class=“my-border my-border-green”

<table class="my-border my-border-green">
  <tr><td>In green</td></tr>
</table>

CSS:
.my-border {
border: 1px solid #000000;
margin-top: 10px;
}
.my-border-green {
border: 1px solid #86BC24;
}
.my-border-red {
border: 1px solid #b52600;
}

Visual output/screenshot:
TableColors.png (1.6 KB)

@brpennington

We suggest you please upgrade to the latest version of Aspose.HTML for .NET 22.1 and let us know how it goes on your side.

If you still face problem, please attach the following resources here for testing:

  • Your input HTML file instead of HTML snippet.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.