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.

<table cellspacing="0" id="MainContent_uscAcntInfo_gridview" style="border-color:#60899B;border-width:1px;border-style:Solid;border-collapse:collapse;">
  <tr align="left" valign="bottom" style="color:#00425F;background-color:#91ADB9;border-color:#60899B;border-width:1px;border-style:Solid;font-weight:bold;">
   <th scope="col">Portfolio Manager</th><th scope="col">Market Value</th>
  </tr><tr>
   <td>BRIAN BRENNAN</td><td class="numbersSums" align="right" style="width:100px;">23,905,236.03</td>
  </tr><tr>
   <td>CHERYL MICKEL</td><td align="right" style="width:100px;">72,401,044.58</td>
  </tr><tr>
   <td>CHRIS ROTHERY</td><td align="right" style="width:100px;">1,017,606.91</td>
  </tr><tr>
   <td>DANIEL SHACKELFORD</td><td align="right" style="width:100px;">36,321,119.13</td>
  </tr><tr >
   <td>Total</td><td >608,347,310.34</td>
  </tr>
</table>

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 <span>, <i>, <b> or <u> element, formatting of paragraph – in <p> or <h1><h6> 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 <th>:

<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)