Skip to content

fix: allow long text to wrap in table cells#13

Merged
fightbulc merged 2 commits intomainfrom
fix/table-text-wrapping
Dec 18, 2025
Merged

fix: allow long text to wrap in table cells#13
fightbulc merged 2 commits intomainfrom
fix/table-text-wrapping

Conversation

@fightbulc
Copy link
Contributor

@fightbulc fightbulc commented Dec 18, 2025

Problem

Long text (especially German compound words) was overflowing table cell boundaries because of white-space: nowrap rules.

Solution

  • Remove white-space: nowrap from th and td:first-child
  • Add word-break: break-word, overflow-wrap: anywhere, hyphens: auto for proper wrapping
  • Keeps table-layout: fixed for consistent column widths across stacked tables

Testing

Tested with German financial tables containing long compound words like "Naturschutzmaßnahmen" and "Flächenbewirtschaftung".

Summary by CodeRabbit

  • Style
    • Improved markdown table rendering to wrap text instead of truncating with ellipses. Table headers, data cells, and first-column content now break and wrap across lines so full text remains visible and more readable when space is limited.

✏️ Tip: You can customize this high-level summary in your review settings.

- Remove white-space: nowrap from th and td:first-child
- Add word-break, overflow-wrap, hyphens for proper wrapping
- Fixes German compound words overflowing cell boundaries
- Keeps table-layout: fixed for consistent column widths
@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Table header and cell styles in the markdown CSS were changed to allow wrapping: nowrap/ellipsis constraints were removed and word-break, overflow-wrap, and hyphenation properties were added so table content can wrap across lines.

Changes

Cohort / File(s) Change Summary
Markdown table cell styling
packages/shared/styles/markdown.css
Removed white-space: nowrap, overflow: hidden, and text-overflow: ellipsis from .markdown-body th and .markdown-body td. Added word-break: break-word, overflow-wrap: anywhere, and hyphens: auto to enable text wrapping in table headers and cells.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single CSS file with homogeneous, straightforward property modifications
  • Visual testing recommended across different content widths and browsers to confirm wrapping and hyphenation behavior

Poem

🐰
No more ellipses hiding lines,
Cells now fold where text aligns.
Words may break and hyphens play,
Tables breathe a brighter day.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change—allowing long text to wrap in table cells by removing nowrap constraints and adding wrap-related CSS properties.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a9b489 and 66dfdf2.

📒 Files selected for processing (1)
  • packages/shared/styles/markdown.css (1 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/shared/styles/markdown.css (1)

273-276: Consider removing redundant word-wrap property.

Line 273 contains word-wrap: break-word, while line 275 adds overflow-wrap: anywhere. Since word-wrap is the legacy alias for overflow-wrap, having both is redundant. The newer overflow-wrap: anywhere will take precedence.

🔎 Apply this diff to remove the redundant property:
 .markdown-body td {
     padding: 8px 16px;
     border: 1px solid var(--border-color);
     vertical-align: top;
     text-align: left !important;
-    word-wrap: break-word;
     word-break: break-word;
     overflow-wrap: anywhere;
     hyphens: auto;
 }

Alternatively, if you want to keep word-wrap as a fallback for older browsers, ensure it matches the overflow-wrap value:

 .markdown-body td {
     padding: 8px 16px;
     border: 1px solid var(--border-color);
     vertical-align: top;
     text-align: left !important;
-    word-wrap: break-word;
+    word-wrap: anywhere;
     word-break: break-word;
     overflow-wrap: anywhere;
     hyphens: auto;
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69d843b and 6a9b489.

📒 Files selected for processing (1)
  • packages/shared/styles/markdown.css (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
packages/shared/styles/**/*.css

📄 CodeRabbit inference engine (AGENTS.md)

Shared styles must be placed in packages/shared/styles/ and organized into theme.css (CSS variables), markdown.css (rendered markdown), and print.css files

Files:

  • packages/shared/styles/markdown.css
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test
  • GitHub Check: build-check
🔇 Additional comments (1)
packages/shared/styles/markdown.css (1)

263-265: Ensure hyphens: auto works for German text by setting the correct lang attribute.

The text wrapping properties look good. However, hyphens: auto requires a matching lang attribute to function—currently the HTML has lang="en", which won't enable German hyphenation. For proper German word-breaking and hyphenation support, either:

  • Set lang="de" on the .markdown-body element or dynamically based on content language
  • Or apply language-specific hyphens rules to the markdown content container

- Remove word-wrap (legacy alias, overflow-wrap suffices)
- Remove hyphens: auto (needs lang attribute to work properly)
@fightbulc fightbulc merged commit 920fbc3 into main Dec 18, 2025
3 of 4 checks passed
@fightbulc fightbulc deleted the fix/table-text-wrapping branch December 18, 2025 13:57
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