This project has moved and is read-only. For the latest updates, please go here.

colspan

Coordinator
Aug 20, 2015 at 2:08 AM
I tried to upgrade to the latest commit to take advantage of recent bug fixes (a big thank you to all who have been working on them) but in doing so, colspans stopped working completely for my table headers. I have no rowspans, only colspans:
<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>
Looking at the document as XML it looks like the colspan attributes are being completely ignored but I can't pinpoint where I am losing them. Any thoughts on where to look?
Coordinator
Aug 20, 2015 at 2:20 AM
To clarify, it seems like I'm losing the "GridSpan" element in the OpenXML:
<w:gridSpan w:val="3"/>
The "old way" of setting this works for me:
            int? colspan = en.Attributes.GetAsInt("colspan");
            if (colspan.HasValue && colspan.Value > 1)
            {
                styleAttributes.Add(new GridSpan() { Val = colspan });
            }
But in the latest build this code doesn't seem to set the colspan for me:
            int? colspan = en.Attributes.GetAsInt("colspan");
            if (colspan.HasValue && colspan.Value > 1)
            {
                properties.GridSpan = new GridSpan() { Val = colspan };
                tables.IndexColumn += colspan.Value - 1;
            }