Markdown Tables Across PDF Pages: Repeated Headers, Wide Tables
Markdown has no idea what a page is. A table in Markdown is just rows, so whatever turns it into a PDF has to decide where the page ends, what to do with the row that straddles the edge, and what to do when the table is wider than the paper. Many converters leave all of that to the browser's print engine, and a wide table then simply runs past the right margin, where the last columns are cut off.
This guide shows what MD Export Desk does in each case. Every example opens in the editor, where the right-hand side shows the actual pages; change the table and watch the breaks move.
A long table: the break falls between rows
When a table reaches the bottom margin, the page ends after the last row that fits completely. The next page starts with a copy of the header row, then the remaining rows. A row is never split between two pages, so a cell with three lines of text stays together.
Three small rules keep the result readable:
- If only one row would fit at the bottom of a page, the whole table starts on the next page instead (for tables of four rows or more). A single orphaned row under a header looks like a mistake.
- In the same way, the last row never sits alone at the top of the next page: one more row moves over with it.
- A heading directly above a table moves with it. You never get "## Maintenance schedule" alone at the bottom of one page and the table on the next.
Open the long-table example: 56 rows on two Letter pages, with the header row at the top of both.
A wide table: smaller text first, then a landscape page
Width is measured as the narrowest the table can get without breaking a word in the middle. If that is wider than the space between the margins, the table goes through these steps and stops at the first that fits:
| Step | What changes |
|---|---|
| 1 | Nothing: the table fits between the margins |
| 2 | Text drops to 85% |
| 3 | The table moves to a landscape page, at full size or at 85% |
| 4 | Still too wide: landscape, 80% text, and long words wrap inside cells |
The landscape page holds only the table (and its heading); the text after it continues on a normal portrait page. In the PDF that page really is landscape, so it reads the right way up on screen and prints sideways on the same paper.
Open the wide-table example: a 14-column laptop inventory that moves to a landscape page. With eleven short columns the same table would only drop to 85% text and stay portrait.
Keeping a wide table on the portrait page
Some documents should not change orientation, for example a form that will be stapled. In Page setup, set Wide tables to Keep portrait. The table then shrinks to 85%, then 75%, and after that long words inside cells wrap at any character so the table always fits. Nothing is cut off at the margin, but very wide tables get tall and narrow.
Open the same table kept portrait and compare it with the landscape version.
Checking a document before you export
The preview lists every decision it made under Layout notes: which tables were shrunk, which moved to a landscape page, which code lines wrapped, and any image that failed to load. Each note links to the line in your Markdown. If a table ends up on a landscape page you didn't expect, the usual fixes are:
- Shorten the header labels; headers are often the widest cell in a column.
- Move a long free-text column (notes, descriptions) into a list under the table.
- Split one wide table into two narrower ones that share the first column.
What the Word export does with the same tables
The .docx uses Word's own table features for the same result: the first row is marked as a header row, so Word repeats it on every page, and each row is set not to break across pages. A table that went landscape in the PDF gets its own landscape section in the Word file. The Markdown to Word converter lists everything else that carries over.
Limits
- A single row taller than a whole page (a cell with several screens of text) can't move to a page where it fits, so it is scaled down to fit one page and listed in the layout notes. Break the text into several rows instead.
- Merged cells (colspan and rowspan) don't exist in Markdown tables. An HTML table pasted into the Markdown is kept, but it breaks between rows the same way and its header row repeats only if it has a thead.
Markdown in, finished pages out. The preview is the PDF.