fix: a cell paragraph drops the default style's space below it

Neither word processor passes it into a cell — LibreOffice puts cell text in
its Table Contents style, Word's table styles carry w:spacing after=0 — so the
space filled the cell and vertical alignment had no slack left to move the text
in, which read as the alignment being ignored. The space above is LibreOffice's
alone, so only the add model zeroes that too. Both exporters write the zeros
onto the paragraph, and only when the default style has spacing at all.
This commit is contained in:
Steffen Becker committed 2026-08-13 23:39:31 +02:00
1 parent 102f2c6cac
commit 06c5f2b12a
7 files changed
+117 -12

No files matched your search

+9 -4
View File
@@ -784,14 +784,19 @@
/* Positioning context for the column-resize handle widget (a child div the
resize plugin places at the cell's right edge). */
position: relative;
/* Cells hold paragraphs; suppress their bottom margin so a single-line cell
isn't taller than its text (matches the list-item paragraph treatment). */
}
.paper .tiptap td > p,
.paper .tiptap th > p {
/* No space below a cell paragraph that names no style: LibreOffice's Table Contents and
Word's table styles both zero it, and the space would fill the cell, leaving vertical
alignment no slack. An inline value (direct formatting) still wins. */
.paper .tiptap :is(td, th) > p:not([data-style]) {
margin-bottom: 0;
}
/* Only LibreOffice's style zeroes the space above too; Word's table styles set the
spacing after alone, so a Word document keeps it (as the cell-start rule above does). */
.paper:not([data-spacing-model='max']) .tiptap :is(td, th) > p:not([data-style]) {
--space-before: 0;
}
/* Header-row cells (tableHeaderRow.ts toggle): bold rendered presentationally so all
text — existing, typed, or pasted — is bold. The light fill comes from the cell's