I have a Word table with 2 columns. I am trying to get Word not to squeeze column1 when column2 has long text that wraps.
here is the intended layout:
column1 Column2 ------- ------- 1. Long text that wraps a couple of times. Another paragraph of long text that wraps. 2. More long text that wraps again. Also another paragraph of long wrapping text.
Notice column2 has 2 paragraphs in each cell. Not sure if this matters, but that's what has to be in there.
When the number of table rows reaches double digits and after I programmatically send the completed document to the browser on the client site (they see it as a download and open it in Word) this is what happens:
column1 Column2 ------- ------- . . . . 9. Long text that wraps a couple of times. Another paragraph of long text that wraps. 1 More long text that 0. wraps again. Also another paragraph of long wrapping text. 1 More long text that 1. wraps again. Also another paragraph of long wrapping text.
Notice how "10." and "11." in column1 get wrapped (because Word decided to squeeze the width of that column,...I think)
I tried increasing the GridColumn width (even to a large value) to no avail. Word always seems to re-size the column widths to what it sees as the best fit...I think. I read on other forums (not Microsoft websites) that all width settings are considered "preferred" only. Not sure if this is true, but it seems true enough in this case!!
I have tried setting
new TableCellProperties()
{
Width = "4000",
Type = TableWidthUnitValues.Pct
}
also
{
Width = "3170",
Type = TableWidthUnitValues.Dxa
}
I have also tried table layout set to fixed:
Type = TableLayoutValues.Fixed
Also set the table cell margins and the TableCellSpacing to 0 in the table properties; but nothing helped.
Is there any OpenXml API that tells Word not to mess with a column's width?