Skip to content

fix(docx): carry table style borders through the conditional resolver#317

Merged
developer0hye merged 1 commit into
mainfrom
fix/docx-table-style-borders
Jul 18, 2026
Merged

fix(docx): carry table style borders through the conditional resolver#317
developer0hye merged 1 commit into
mainfrom
fix/docx-table-style-borders

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

  • Table styles' base w:tblBorders and per-region w:tcBorders (inside w:tblStylePr) were dropped — the conditional resolver carried only background/text color/bold, so styles drawing white grids over dark fills lost their borders (removing fallback gridlines in XLSX: match Excel print metrics for columns, margins, gridlines #277 could not fix this)
  • Parse both border sets per region; resolve each cell's edges from the base grid (outer edges on boundary cells, insideH/insideV on interior edges); an active special region's explicit sides override the matching edges of its own cells (a firstRow bottom border lands on the header row's bottom edge even though it's interior to the table)
  • Explicit cell tcBorders still win over the style

Test plan

  • New unit test: white base grid resolved per cell position, firstRow double red bottom override, nil-side skipping (TDD, red first)
  • Full workspace suite passes; fmt --check clean; clippy -D warnings clean

Visual verification (public oxp_complex_table fixture, 150 DPI)

Word GT Before After
gt before after

The white grid now separates the black/gray banded cells like Word.

After-image re-audit

The remaining serif body font on this fixture is the theme-font default resolution — fixed separately in #316 (merged after this branch's render; the fixes compose on main).

Related: #289

🤖 Generated with Claude Code

Table styles' base w:tblBorders and per-region w:tcBorders were
dropped — the conditional resolver carried only background, text
color, and bold, so styles drawing white grids over dark fills lost
their borders. Parse both border sets per region, resolve each cell's
edges from the base grid (outer edges on boundary cells, insideH/V on
interior edges), and let an active special region's explicit sides
override the matching edges of its own cells — a firstRow bottom
border lands on the header row's bottom edge even though that edge is
interior to the table. Explicit cell tcBorders still win.

Related: #289

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit e7ea3d7 into main Jul 18, 2026
14 checks passed
@developer0hye
developer0hye deleted the fix/docx-table-style-borders branch July 18, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant