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

Free Support Forum - aspose.com

InsertHtml Loosing CSS formatting

Hi,


I’m trying to insert a simple HTML table as a test for a merge I will be trying to do.

DocumentBuilder builder = new DocumentBuilder(docMerge);
builder.InsertHtml(@"
table {
border: 1px solid black;
width: 100%;
border: 1;
}
thead {
background-color: #AEAAAA;
}
Some Header Some other Header Another header Yet another
My data My data My data My data
");

But the output, though it does make a table, the CSS is not applied. I have tried using inline CSS too but I could only get a border to show, everything in the ‘style’ tag was ignored.
Any ideas as to why?

I have managed to get the backgound color to show but things like font size are doing nothing.

Here is my latest test and it ignores most of the css, only seeing the background color on the table as far as styles go.

builder.InsertHtml(@"
.tableStyle{border: 1px solid black; width: 100%;border: 1; width: 100%; font-size:9; font-family: Calibri, sans-serif;}
.theadStyle{background-color: #AEAAAA; font-weight: bold; font-size:9; font-family: Calibri, sans-serif;}
Some Header Some other Header Another header Yet another
My data My data My data My data
");


Hi Aaron,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the table's border issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-14779. You will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

We have not found the remaining issues while using latest version of Aspose.Words for .NET 17.1.0. Please use Aspose.Words for .NET 17.1.0. We have attached the output docx with this post for your kind reference.

@Gibson,

The issues you have found earlier (filed as WORDSNET-14779) have been fixed in this Aspose.Words for .NET 17.9 update and this Aspose.Words for Java 17.9 update.