Format Markdown tables so that they are readable by humans

Resolved 💬 36 comments Opened Dec 18, 2025 by PaulRBerg Closed May 11, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

Markdown tables generated by Codex are not readable by humans - their whitespaces are off.

Additional information

<img width="1071" height="217" alt="Image" src="https://github.com/user-attachments/assets/40d51be6-869d-43c8-bc8b-aed8680484f1" />

View original on GitHub ↗

36 Comments

kanlanc · 7 months ago

Not just this but even text outputs, it almost feels like codex is afraid of spacing

PaulRBerg · 7 months ago
guyisra · 5 months ago

any updates on this? OpenCode has this and this is basically a quick prompt to fix

etraut-openai contributor · 5 months ago

@guyisra, we generally prioritize features based on upvotes. There are many features ahead of it in the queue.

guyisra · 5 months ago
kt-devoss · 4 months ago

+1
I agree that human-readable tables are preferable for terminal output.

Not just this but even text outputs, it almost feels like codex is afraid of spacing

However, for repository files, diff-friendly formatting is usually better.
If columns are realigned, even a single change can rewrite the entire table, causing noisy diffs and breaking git blame.
Minimal spacing keeps the change to one line.

So repository files should stay diff-friendly, and only CLI/terminal output should be human-readable.

---

Human-friendly (aligned columns)

Good for terminal output.
But a small change rewrites the whole table, and git blame becomes unreliable.

| Animals | Nature | Colors |
|---------|--------|--------|
| cat     | sun    | red    |
| dog     | sky    | blue   |
| fox     | sea    | green  |
| Animals      | Nature | Colors |
|--------------|--------|--------|
| cat          | sun    | red    |
| Hippopotamus | sky    | blue   |
| fox          | sea    | green  |

---

Diff-friendly

Minimal diffs. Git-friendly. git blame remains accurate.
Better for repository files.

| Animals | Nature | Colors |
| ------- | ------ | ------ |
| cat | sun | red |
| dog | sky | blue |
| fox | sea | green |
| Animals | Nature | Colors |
| ------- | ------ | ------ |
| cat | sun | red |
| Hippopotamus | sky | blue |
| fox | sea | green |
PaulRBerg · 4 months ago

Maybe Codex can generate diff-friendly tables but use a Markdown renderer to display the table in the chat?

leeeezx · 4 months ago
@guyisra, we generally prioritize features based on upvotes. There are many features ahead of it in the queue.

I think this problem maybe more important for normal users,who work with text and chat.

pipi-1997 · 4 months ago

I dug into the current Rust TUI implementation and found that markdown tables appear to be unsupported in the renderer today, which seems to explain why table output still shows up as effectively raw pipe syntax in the transcript.

Root cause on main:

  • In codex-rs/tui/src/markdown_render.rs, the pulldown-cmark options only enable ENABLE_STRIKETHROUGH; table parsing is not enabled.
  • The renderer matches Tag::Table(_), Tag::TableHead, Tag::TableRow, and Tag::TableCell, but currently ignores all of them in both start_tag(...) and end_tag(...).

So this looks less like a spacing-only problem and more like missing table support in the Rust TUI markdown renderer.

A focused implementation path would be:

  • enable markdown table parsing in the parser options
  • collect table rows/cells during markdown rendering
  • render a readable terminal table in transcript output
  • mirror the same behavior in codex-rs/tui_app_server/src/markdown_render.rs, since it has the parallel implementation
  • add snapshot / renderer coverage for tables, since current markdown_render_tests.rs does not appear to cover them

If this direction matches the intended solution, I’d be happy to help sketch a concrete implementation plan.

pipi-1997 · 4 months ago

Follow-up: I implemented a concrete draft fix on my fork and tried to open an upstream PR, but GitHub rejected createPullRequest for my account on this repository.

Implementation branch:

Compare view against openai/codex:main:

What is included:

  • readable table rendering in codex-rs/tui
  • the same rendering path mirrored in codex-rs/tui_app_server
  • streaming table buffering so partial table syntax is not emitted before the table block is complete
  • focused tests plus updated markdown snapshots

Verification I ran locally:

  • cargo test -p codex-tui
  • cargo test -p codex-tui-app-server

If this direction matches the intended solution and you would like an invited PR instead, I can re-open the contribution through the preferred flow.

leeeezx · 4 months ago

this problem need to be fixed

Microck · 4 months ago

bump

shrinidhi4u · 3 months ago

Can we get some attention to this issue please?

etraut-openai contributor · 3 months ago

@shrinidhi4u, we generally prioritize feature requests based on upvotes. This feature request has received a fair number of upvotes so it will likely reach the front of the priority queue soon.

expozeur · 3 months ago

When will Codex be upgrading its formatting and readability to keep up with other clients/apps which have had this basic stuff for years?

igamenovoer · 3 months ago

this is very much needed, reading raw md table is a pain

raulk · 3 months ago

Came here to say that this is a crime:

<img width="740" height="447" alt="Image" src="https://github.com/user-attachments/assets/a61a71f0-1975-4e75-bace-5f4aa0660eda" />

Claude Code renders tables quite nicely -- and they're adaptive! So if the table grows too much and overflows, or if the screen is narrow, it'll switch to a stack of blocks separated by a divider.

leeeezx · 3 months ago
Came here to say that this is a crime: <img alt="Image" width="740" height="447" src="https://private-user-images.githubusercontent.com/1101242/577602272-a61a71f0-1975-4e75-bace-5f4aa0660eda.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzYyMjM2MzAsIm5iZiI6MTc3NjIyMzMzMCwicGF0aCI6Ii8xMTAxMjQyLzU3NzYwMjI3Mi1hNjFhNzFmMC0xOTc1LTRlNzUtYmFjZS01ZjRhYTA2NjBlZGEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDQxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA0MTVUMDMyMjEwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9N2ZmNGYzMjFjNTU4YWJmNWNhM2NlMTJmYmUxMGZhOGQyMjhkMTM1NjZkZDBiMWJhNTlmNDY4ZTY5NGIwZDFhOCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.EGlfT2TBTG_AJ8u7sgi7QLk68inL5Y3jMO_Aqk1wx3U"> Claude Code renders tables quite nicely -- and they're adaptive! So if the table grows too much and overflows, or if the screen is narrow, it'll switch to a stack of blocks separated by a divider.

This is reason that i only use codex app not codex cli. Terrible table. Table is a common format to organize information and increasing information density, so so so common. But cant work well in codex cli.

zenoran · 3 months ago

Yikes... can openai not vibe code a fix for this? It's crazy the TUI agent responses are spitting out markdown code for tables... looks so jank.

tgvdinesh · 3 months ago

Use the below prompt. It will fix the render of table

CODEX TABLE RENDERING CONTEXT

  Use this as a system prompt or include in your task description:

  For all Node.js/JavaScript code that outputs tables or data:

  1. ALWAYS use the `cli-table3` package for structured tables:
     npm install cli-table3

  2. TABLE RENDERING TEMPLATE:
     ```javascript
     const Table = require('cli-table3');

     const table = new Table({
       head: ['Column 1', 'Column 2', 'Column 3'].map(h => '\x1b[36m' + h + '\x1b[0m'),
       style: { head: [], border: ['cyan'], 'padding-left': 1, 'padding-right': 1 },
       wordWrap: true,
       colWidths: [25, 20, 15],
       rowHeight: 2
     });

     data.forEach(row => table.push(Object.values(row)));
     console.log(table.toString());

  3. DATA-HEAVY FINANCE/RECONCILIATION:
    - Use fixed-width columns with proper alignment
    - Right-align numbers: pad with spaces on left
    - Left-align text: pad with spaces on right
    - Use currency format: $X,XXX.XX (not raw numbers)
  4. COLOR/FORMATTING:
    - Headers: \x1b[36m (cyan) for visibility
    - Borders: cyan for clean look
    - Totals rows: bold+yellow (\x1b[1m\x1b[33m)
    - Negative values: red (\x1b[31m)
  5. ALWAYS:
    - Set explicit colWidths (no auto-wrap breaking)
    - Use wordWrap: true for long cells
    - Include row counts and totals at bottom
    - Right-align all numeric columns
  6. OUTPUT VALIDATION:
    - Test output by printing to console
    - Verify no lines exceed 120 chars width
    - Check all columns align vertically

  ---

  ## **QUICK REFERENCE FOR CODEX**

  When asking Codex, include this in your prompt:

  Generate Node.js code using cli-table3 for table output.
  Format: monetary values right-aligned, text left-aligned.
  Include column headers in cyan, borders in cyan.
  Set colWidths explicitly. Example structure:

  const Table = require('cli-table3');
  const table = new Table({
    head: ['Category', 'Amount', 'Status'].map(h => '\x1b[36m' + h + '\x1b[0m'),
    style: { head: [], border: ['cyan'], 'padding-left': 1 },
    colWidths: [20, 15, 12],
    wordWrap: true
  });
  // Add rows, console.log(table.toString())

  ---

  ## **SAVE THIS AS A FILE**

  Create `~/.codex-table-context.txt` and reference it:

  ```bash
  # In your Codex session, include:
  "Use the table rendering guidelines from ~/.codex-table-context.txt"

  Or add to your Codex system prompt if it supports custom instructions.
tgvdinesh · 3 months ago
zenoran · 3 months ago
This fixed the table for me https://github.com/openai/codex/issues/8259#issuecomment-4256642378

Obviously anyone can vibe code a fix that isn't the point though. We shouldn't have to build our own every time a new release comes out for such a foundational feature.

It's probably an intentional mask for a bug to avoid doing platform compatibility testing. I say bug because u don't typically implement markdown and skip basic functionality unless it caused issues. Streaming tables can be tricky based on everyone's terminal support.

I think it's definitely worth prioritizing though. Markdown is the LLM's native tongue. The client should support it.

lipeng-unisound · 2 months ago

Adding another real-world repro from today: Codex CLI returned a Markdown table for a service reachability report, and in the terminal it was shown as raw pipe syntax instead of a rendered table. The user explicitly asked whether Codex CLI cannot render Markdown because the output was hard to scan.

This is not just cosmetic. Tables are one of the most common formats for status reports, test matrices, service checks, code review findings, and release summaries. When the CLI shows raw Markdown, the agent has to avoid Markdown tables and fall back to manually aligned plain text.

Desired behavior:

  • Render Markdown tables in the TUI transcript output.
  • Keep generated repository files diff-friendly; this request is about chat/terminal display only.
  • For narrow terminals, follow the pattern other terminal agents use: render readable columns when possible, and fall back to stacked key/value blocks when the table would overflow.

Claude Code handles this class of output much more cleanly today. Codex CLI would benefit a lot from native Markdown table rendering rather than requiring every agent response to work around the display layer.

adammcarter · 2 months ago

Please 😭

MrPeker · 2 months ago

The way this is being handled is similar to Apple's delay in rolling out the copy-paste feature

Liooo · 2 months ago

Been also bothered by this, made an app that renders selected markdown in popover.
It's been working well enough for me as a workaround, so I released it. May mitigate your pain until the issue is resolved.

repo: https://github.com/Liooo/glance.md

<img width="800" height="551" alt="Image" src="https://github.com/user-attachments/assets/07e29d99-26d9-42fb-9a46-ea7d6cba5583" />

JC-Flanders · 2 months ago

+1.

Hard for humans to read table output from codex cli. Unfortunately, I'm a human.

rahul342 · 2 months ago

Please improve this. It's very common to have tables in responses.

michellemoorre · 2 months ago

I've been using Codex for the past few months as a DL researcher, and it's absolutely terrible. I spend countless hours looking at tables every day. Meanwhile, I don't see any real changes in Codex CLI itself. Please find a solution, it's unbearable.

diegomrsantos · 2 months ago

I validated a local implementation for this with a deliberately small scope: rich TUI transcript rendering only, leaving generated repository Markdown and raw output mode unchanged.

What I found:

  • The current TUI renderer does not enable pulldown_cmark::Options::ENABLE_TABLES.
  • Tag::Table, TableHead, TableRow, and TableCell are currently ignored in the markdown renderer.
  • A focused fix can live in the existing rich markdown render path, so completed messages, streamed responses, plans, reasoning summaries, markdown prompts, and resume previews all benefit without adding a config flag or dependency.
  • Wide terminals can render aligned columns cleanly.
  • Narrow terminals need a stacked fallback such as Header: value; otherwise wrapped tables become harder to read than raw Markdown.
  • Streaming needs a small holdback for likely table blocks so the header row is not emitted as raw pipe text before the delimiter/body rows arrive.

I have this working locally with focused renderer tests, streaming coverage, and insta snapshots for wide table rendering, narrow fallback, streamed TUI output, and raw-mode preservation.

If maintainers want this direction, I can open an invited PR. If you prefer app-server renderer parity in the same PR, I can include that as well; otherwise I would keep the first PR TUI-only and small.

ririnto · 2 months ago
+1 I agree that human-readable tables are preferable for terminal output. > Not just this but even text outputs, it almost feels like codex is afraid of spacing However, for repository files, diff-friendly formatting is usually better. If columns are realigned, even a single change can rewrite the entire table, causing noisy diffs and breaking git blame. Minimal spacing keeps the change to one line. So repository files should stay diff-friendly, and only CLI/terminal output should be human-readable. #### Human-friendly (aligned columns) Good for terminal output. But a small change rewrites the whole table, and git blame becomes unreliable. `` | Animals | Nature | Colors | |---------|--------|--------| | cat | sun | red | | dog | sky | blue | | fox | sea | green | ` ` | Animals | Nature | Colors | |--------------|--------|--------| | cat | sun | red | | Hippopotamus | sky | blue | | fox | sea | green | ` #### Diff-friendly Minimal diffs. Git-friendly. git blame remains accurate. Better for repository files. ` | Animals | Nature | Colors | | ------- | ------ | ------ | | cat | sun | red | | dog | sky | blue | | fox | sea | green | ` ` | Animals | Nature | Colors | | ------- | ------ | ------ | | cat | sun | red | | Hippopotamus | sky | blue | | fox | sea | green | ``

Three - are also valid and good.

| Animals | Nature | Colors |
| --- | --- | --- |
| cat | sun | red |
| Hippopotamus | sky | blue |
| fox | sea | green |

| Animals | Nature | Colors |
| --- | --- | --- |
| cat | sun | red |
| Hippopotamus | sky | blue |
| fox | sea | green |

It passed markdownlint-cli2.

fangyuqiang · 2 months ago

Fix this please

janvitos · 2 months ago

I'm trying to use Codex and GPT 5.5 for data analysis and comparison, and it's just not working because of this problem. Tables are all scrambled. Most other CLIs have this right.

Having to constantly ask Codex to fix its tables is the number one issue that's preventing me from using it as a daily driver.

Please fix it.

wylflc · 2 months ago

Please fix this.

Codex CLI has improved the output a lot on spacing. Please improve also on the table view and equation rendering.

DanilaMihailov · 2 months ago

seems like it will be in the new release https://github.com/openai/codex/pull/22052

etraut-openai contributor · 2 months ago

This will be addressed in the next release of the CLI (0.131.0).