Parser reliability
Designing Markdown Tables for 80-Column Terminal Output
Written and reviewed by the md2text maintainer. Parser-specific guidance is checked against the automated regression suite.
An 80-column limit is still useful for plain-text tables. Terminals, diffs, email previews, code review comments, and source files all become harder to scan when lines wrap. A table that looks tidy in a browser can turn into a stack of broken fragments when pasted into a narrow destination.
The best fix is not always a smaller font or a wider terminal. The better habit is to design the Markdown table with the destination in mind.
Estimate width before conversion
Plain-text table width is driven by cell content. Borders and padding add extra characters, but the longest values usually decide whether the output is safe.
Start with the widest likely row:
| Option | Default | Description |
|---|---:|---|
| --cache-directory | .cache/md2text | Stores generated preview files |
Even if each value looks reasonable, the combined line can exceed 80 columns after borders are added. If you need the table to fit in a terminal, treat long descriptions as a warning sign.
Move long explanation out of the table
Tables are strongest when each cell contains a label, value, status, number, or short phrase. Long prose belongs before or after the table.
Instead of this:
| Flag | Description |
|---|---|
| --strict | Fails conversion if any row has too many cells or if a table separator cannot be parsed |
Use this:
| Flag | Behavior |
|---|---|
| --strict | Fail on invalid rows |
Then add detail below the table:
Use --strict in CI when generated documentation should fail fast on malformed tables.
The table becomes scannable, and the explanation stays readable.
Choose the right output style
Different styles have different width costs:
| Style | Width behavior | Best use |
|---|---|---|
| Grid ASCII | Adds borders and padding | Source comments, email, legacy tools |
| Unicode box | Similar width to grid | Modern terminals, release notes |
| Simple text | Least visual structure | Narrow screens, quick replies |
If the max line is close to 80 columns, Simple text may be the safer output. If the table is under 60 columns, Grid ASCII or Unicode usually gives better scanability.
Split tables by task
A table with too many columns is often trying to answer multiple questions. For CLI docs, split reference data from examples:
| Flag | Default | Required |
|---|---:|:---:|
| --output | dist | no |
| --strict | false | no |
Then add examples separately:
| Task | Command |
|---|---|
| Build docs | md2text --output docs |
| Check only | md2text --strict |
Two small tables are easier to paste into README files and terminal docs than one wide table.
Watch CJK and emoji width
Visible width is not always the same as character count. Chinese, Japanese, Korean, and many emoji can occupy more visual width than ASCII letters. A line that appears to contain 70 characters may render wider in a terminal.
For status tables, keep emoji decorative rather than essential:
| Area | Status |
|---|---|
| Docs | ✅ Ready |
| API | ⚠️ Review |
This can work well, but test the final output in the destination if the table is close to 80 columns.
Practical thresholds
Use these thresholds as a working rule:
| Max visible line | Recommendation |
|---|---|
| 60 or less | Safe for most destinations |
| 61-80 | Good for terminals and email |
| 81-120 | May wrap in narrow terminals |
| 121+ | Too wide for many plain-text contexts |
When the output is too wide, shorten labels, remove nonessential columns, switch to Simple text, or split the table.
Convert your own table
Paste a Markdown table into the converter and choose ASCII grid, Unicode box, or Simple text output. Conversion runs locally in your browser.
Convert a Markdown table