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

Free Support Forum - aspose.com

Applying colors/formatting through table and inserting into Word

Hi,

I have an html table with inline formating for color, alignment etc...it displays correctly in browser, but when i try to insert same in word using aspose, i dont get same formatting in the word document.















Portfolio Manager Market Value
BRIAN BRENNAN 23,905,236.03
CHERYL MICKEL 72,401,044.58
CHRIS ROTHERY 1,017,606.91
DANIEL SHACKELFORD 36,321,119.13
Total 608,347,310.34

code--

public void FieldMerging(FieldMergingArgs e)

{

DocumentBuilder builder = new DocumentBuilder(e.Document);

builder.MoveToMergeField(e.DocumentFieldName);

builder.InsertHtml(Convert.ToString(e.FieldValue));

}

here e.FieldValue contains the html string written above...

Please suggest

thanks in advance

Hello

Thanks for your inquiry. The problem with borders occurs, because Aspose.Words does not fully support table styles upon HTML import. I linked your request to the appropriate issue. You will be notified as soon as it is resolved.

The problem with text occurs because Aspose.Words does not support inheriting formatting from parent elements. Currently, Aspose.Words expects that font formatting is set in , , or element, formatting of paragraph – in

or

elements etc…

In your case, font color of text should be set in <span> tag. Please see the following HTML:

<tr>

<th scope="col">

<span style="color: #00425F;">Portfolio Manager</span>

</th>

<th scope="col">

<span style="color: #00425F;">Market Value</span>

</th>

</tr>

Best regards,

what tags should i use for background color? will it be captured inside ?

Hello

Thanks for your inquiry. You should set background color for

:

<tr>

<th style="background-color: #91ADB9;">

<span style="color: #00425F;">Portfolio Manager</span>

</th>

<th style="background-color: #91ADB9;">

<span style="color: #00425F;">Market Value</span>

</th>

</tr>

Hope this helps.

Best regards,

The issues you have found earlier (filed as WORDSNET-318) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(33)

The issues you have found earlier (filed as WORDSNET-2021) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(50)