Align Markdown table columns in Claude Code
Size columns from the header and widest value, pad cells and separator rows, and preserve alignment markers.
中文Install in Claude Code
A Claude Code workspace with an editable Markdown table. The example covers short text and a right-aligned cost column.
- Review `.claude/skills/format-table/SKILL.md` and its requirements at the pinned GitHub commit.
- Create `.claude/skills/format-table/` in your project and save the reviewed file as `.claude/skills/format-table/SKILL.md`.
- Start Claude Code from that project's root, then select `/format-table` in the slash menu.
Example task
The unaligned table has `{headers:['Item','Cost'],rows:[['Ink','5'],['Paper','12']],alignment:'right for Cost'}`. Preserve the contents and right-align cost.What to check
Use header `| Item | Cost |` and separator `|-------|-----:|`. Data rows are `| Ink | 5 |` and `| Paper | 12 |`. Keep the widths consistent within each column.
Original SKILL.md on GitHub · Updated
Frequently asked question
How do I align costs in Markdown source without changing the values?
Set column widths from headers and maximum cell lengths, then pad each cell. Keep the right-alignment marker and check the original values are preserved.