This project has moved. For the latest updates, please go here.

Table Background Color missing

Coordinator
Sep 27, 2016 at 7:43 PM
I am using the SDK 2.5/.NET 4.0 set. Consider the following HTML table:
<tr class="TableHeaderCells">
     <th style="background-color:#FFFF99;" colspan="4"></th>
     <th style="background-color:#FFFF99;" colspan="7"></th>
     <th style="background-color:#FFFF99;" colspan="5">[Header Text]</th>
</tr>
<tr class="TableHeaderCells">
     <th style="background-color:#FFFF99;" colspan="4"></th>
     <th style="background-color:#FFFF99;" colspan="3">[More Header Text]</th>
     <th style="background-color:#FFFF99;" colspan="4">[Even More Header Text]</th>
     <th style="background-color:#FFFF99;" colspan="3">[Still Even More Header Text]</th>
     <th style="background-color:#FFFF99;" colspan="2">[So Much Header Text]</th>
</tr>
When I use HTMLtoOpenXML to convert this table, I lose the "background-color" style and I haven't been able to pinpoint why yet. I think it might be here in TableStyleCollection.ProcessCommonAttributes:
            var colorValue = en.StyleAttributes.GetAsColor("background-color");

            // "background-color" is also handled by RunStyleCollection which duplicate this attribute (bug #13212). Let's ignore it
            if (!colorValue.IsEmpty && en.CurrentTag.Equals("<td>", StringComparison.InvariantCultureIgnoreCase)) colorValue = System.Drawing.Color.Empty;
Has anybody else seen this happen to them? If so, how did you address the issue?