Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table Background Color missing #12

Closed
onizet opened this issue Oct 20, 2017 · 0 comments
Closed

Table Background Color missing #12

onizet opened this issue Oct 20, 2017 · 0 comments
Assignees

Comments

@onizet
Copy link
Owner

onizet commented Oct 20, 2017

[copied from codeplex]

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?

@onizet onizet self-assigned this Oct 20, 2017
onizet added a commit that referenced this issue Jan 5, 2018
#20). Fix also table with border=0, consecutive to previous commit with predefined styles
@onizet onizet closed this as completed Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant