Skip to content

fix(markdown): wrap table cells instead of forcing horizontal scroll - #196

Merged
akemmanuel merged 1 commit into
akemmanuel:masterfrom
touch2be:fix/markdown-table-wrap
Nov 18, 2026
Merged

akemmanuel merged 1 commit into
akemmanuel:masterfrom
touch2be:fix/markdown-table-wrap

Conversation

@touch2be

Copy link
Copy Markdown
Collaborator

Problem

Markdown tables in chat used min-w-max, so a table always grew to the width of its longest unwrapped content. Any table with prose in a cell (e.g. a "finding" column) ran far past the chat column, and every row needed horizontal scrolling to read.

Change

Only styles/globals.css (.markdown-renderer table rules):

  • Remove min-w-max: tables fit the chat column and cell text wraps.
  • Cells wrap at word boundaries (overflow-wrap: break-word), so a column never gets narrower than its longest word and words are not split mid-word (previously anywhere allowed columns to collapse to single characters).
  • Links and inline code inside cells may break anywhere, so a single long URL or path cannot force the table wide.
  • Lower the per-column floor from 8rem to 4rem (mobile: 6rem to 3.5rem) so short numeric columns stay compact.
  • text-wrap: balance on header cells.

The .markdown-table-scroll wrapper and its horizontal scroll stay as a fallback for tables whose words genuinely cannot fit (e.g. eight columns on a phone).

Verification

Rendered a 2-column prose table (with a long URL and a code path) and an 8-column numeric table with the same rules at three viewport widths:

Table 1440 px 820 px 390 px
2 columns, prose fits fits fits
8 columns fits 28 px overflow (was ~450 px) scrolls (expected)

Formatting check passes. Not tested inside the running app.

Tables in chat used min-w-max, so they always grew to their widest
unwrapped content and every long row needed horizontal scrolling.

- Drop min-w-max so tables fit the chat column and cell text wraps.
- Wrap at word boundaries (overflow-wrap: break-word), so a column is
  never narrower than its longest word and words are not split mid-word.
- Let links and inline code in cells break anywhere, so one long URL or
  path cannot force the table wide.
- Lower the per-column floor (8rem -> 4rem, mobile 6rem -> 3.5rem) so
  short numeric columns stay compact.
- Balance header wrapping.

Horizontal scrolling remains as a fallback for tables whose words cannot
fit (e.g. many columns on mobile).
@akemmanuel
akemmanuel merged commit 635d2b9 into akemmanuel:master Nov 18, 2026
1 of 2 checks passed
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.

2 participants