feat: a table keeps the cell margins its file gave it

The cell padding was a constant in three places that disagreed with each
other, so a narrow column lost 0.38cm it did not have: a bibliography
marker column of 0.71cm wrapped "[2] " onto three lines and every entry
grew with it, costing a fixture a whole page.

The table now carries its own margins (w:tblCellMar, direct or from the
table style; fo:padding on the ODF cell style) and both exports write
them back. A side within a twentieth of a millimetre of the default is
the default, or Word's 108 twips would tag every table.
This commit is contained in:
Steffen Becker committed 2026-08-08 12:18:16 +00:00
1 parent e4b679ad8b
commit db0fe71cdb
11 files changed
+174 -16

No files matched your search

+3 -3
View File
@@ -481,8 +481,8 @@
and the exported .odt look identical (see export/odt.ts CUST_TABLE handler):
• border → export emits 0.5pt solid #000000; 1px solid renders crisply
on screen and is the visual equivalent of a thin 0.5pt line.
• padding → Word's/LibreOffice's cell margins; export emits them per side
(CELL_PADDING_X/_Y, expanded by expandCellPadding).
• padding → Word's/LibreOffice's cell margins. The fallback below is Word's
own default; a file's own value rides --cell-pad (tableCellPadding.ts).
Tables are wrapped in <div class="tableWrapper"> by TipTap's node view. */
.paper .tiptap .tableWrapper {
/* Default is flush with the text area; a dragged outer edge sets an inline
@@ -504,7 +504,7 @@
.paper .tiptap td,
.paper .tiptap th {
border: 1px solid #000;
padding: 0 0.19cm;
padding: var(--cell-pad, 0 0.19cm);
vertical-align: top;
/* Positioning context for the column-resize handle widget (a child div the
resize plugin places at the cell's right edge). */