Commit 7de83db
authored
Fill the table grid from the cell widths (#45)
Word lays a table out from w:tblGrid, and the grid was always written as an
even split. Cell widths were emitted faithfully onto every tcW and then had no
effect: the columns rendered equal however wide the cells said they were. The
widths being present and correct in the XML is what made it hard to see, since
reading the output suggested nothing was wrong.
Column widths now come from col/colgroup where it is present, and otherwise
from the first row that maps one cell to one column. A row carrying a colspan
or rowspan is skipped, since the mapping is ambiguous, and so is one where only
some cells give a width, since half a row cannot lay out a table. Percentages
still cannot fill the grid - w:gridCol has no percentage unit, the same reason
col percentages are ignored - so they continue to apply to the cells alone.
Sharing an absolute table width across the columns now happens only when the
cells give no widths of their own. That combination was the worst case: a table
with an explicit width and sized cells took the even share, so the widths were
not merely inert but overwritten.
The five updated snapshots all move the same way, from a bare gridCol to a
sized one plus the fixed layout that makes Word honour it.
Closes #441 parent fac4561 commit 7de83db
15 files changed
Lines changed: 122 additions & 9 deletions
File tree
- src
- OpenXmlHtml.Tests
- OpenXmlHtml
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
| 480 | + | |
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
483 | 484 | | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
484 | 492 | | |
485 | 493 | | |
486 | 494 | | |
| |||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments