Wide Markdown tables: why they scroll sideways, and how to read them whole

A Markdown table runs off the side when its narrowest possible layout is still wider than the window. Each column can only shrink to its longest word, and file names, paths and URLs usually can't break. Most previews then add a sideways scrollbar or cut the table off. To read it whole, either write the table so it can wrap, or read it in a viewer that fits tables to the window, as Pagewide does.

Below: what causes it, what different apps do, how to write tables that fit, and how Pagewide handles the ones you didn't write.

Why a Markdown table gets too wide

A browser lays out a table by asking each column how narrow it can get. The answer is the longest piece of text in that column that can't be split. Add those up across every column, plus the padding, and that is the table's minimum width.

Ordinary words are short, so prose columns wrap easily. The trouble is unbreakable text: a path such as plans/07_PRICING_PAGE_annual_first.md, a long URL, an ID, or a code name joined with underscores. A browser won't split those by default, so one long path can set the width of a whole column.

The other cause is a narrow window. A table that fits a full screen can overflow in a side pane: an editor's preview next to your code, a chat panel, or one half of a split view.

What most Markdown previews do with a wide table

When a table is wider than its space, an app has three choices: scroll it sideways, cut it off, or change how it looks. All three are in use.

A table drawn with GitHub-style Markdown table styles in a narrow pane: the file names don't break, so the Status column is cut off at the right edge
A rollout table drawn with GitHub's Markdown table styles in a 470-pixel pane. The file names can't break at underscores, so the Status column sits off the right edge. You would scroll sideways for every row.

How to write Markdown tables that fit

If you write the table, a few habits keep it narrow. They help in every app, including on GitHub.

  1. Keep long paths out of cells, or shorten them. Put the full path in a sentence below the table, or show only the file name.
  2. Fewer columns. Five or six is plenty for a screen. Split a table that needs more, or turn rarely used columns into notes.
  3. Put explanations in the last column. A wide "Notes" column at the end wraps well, because it is prose.
  4. Turn a very wide table on its side. If it has many columns and few rows, swap rows and columns.

For a website, a common fix is CSS that lets long text break inside cells, such as overflow-wrap: anywhere on table cells. That is close to what Pagewide does for you.

How Pagewide reads wide tables whole

Pagewide fits every table to the window and never scrolls it sideways. Every table spans the page, and its cells wrap at word boundaries. If a table still comes out too wide, Pagewide takes three steps, one at a time, and stops as soon as the table fits:

  1. Code and links may break anywhere. These are usually the long, unbreakable parts, so this alone fixes most tables.
  2. The cells get tighter, with less padding and slightly smaller text.
  3. As a last resort, any word in that table may break.

Ordinary words stay whole unless nothing else works. Pagewide checks again whenever the window changes size, so a table that needed help in a narrow pane goes back to normal in a wide one.

A six-column API table in Pagewide with long notes wrapping inside the window
Pagewide: a six-column table with long notes, wrapped to fit the window.
Two Markdown files side by side in Pagewide, with a four-column table fitting the narrow left pane
Pagewide in split view: each file gets half the window, and the table in the left pane still fits.

This matters most for files you didn't write. AI coding tools, generated docs and exported reports put long paths in tables all the time. Reading a whole folder of them is where Pagewide is meant to help.

Questions

Can I make a Markdown table scroll horizontally on purpose?

Markdown itself has no setting for it. On a website, wrap the table in a box with CSS overflow-x set to auto, or use styles that do this already, such as GitHub's. The app or site that shows the Markdown decides, not the file.

Why does my table fit on GitHub but not in my editor's preview?

Usually because the preview pane is narrower. The table's minimum width stays the same, so in a side pane it overflows. Long file names and URLs in cells make this happen sooner.

Does Pagewide change my Markdown file?

No. Pagewide is read-only. Fitting a table only changes how it is shown on screen. The file on disk stays exactly as it was.

Do tables also fit when I print from Pagewide?

Yes. Printed tables wrap their cells the same way, headings stay with the text that follows them, and table rows are kept whole across page breaks.

References

  1. GitHub Flavored Markdown spec, tables.
  2. github-markdown-css, the stylesheet behind GitHub-style Markdown, used for the first figure.
  3. Cursor forum, Markdown preview does not allow horizontal scrolling for wide tables.
  4. MDN, overflow-wrap.