# Markdown Table Formatter Align a Markdown table or convert CSV to Markdown — zero dependencies. ``` python scripts/run.py table.md python scripts/run.py data.csv --from csv python scripts/run.py data.tsv --from csv --delimiter $'\t' cat table.md | python scripts/run.py - ``` Pure Python stdlib (`csv` + string formatting). --- name: markdown-table-formatter display_name: Markdown Table Formatter description: "Align and prettify a Markdown table, or convert CSV into a Markdown table with aligned columns. Triggers: format markdown table, align table, csv to markdown, prettify table, markdown table." --- # Markdown Table Formatter Tidy up a messy Markdown table or turn CSV into a clean Markdown table. ## When to use The user pasted a ragged Markdown table whose pipes don't line up, or has CSV data they want rendered as a Markdown table. ## How to use Run `scripts/run.py` with the input: - `python scripts/run.py table.md` — re-align an existing Markdown table (preserves `:--`/`--:` alignment). - `python scripts/run.py data.csv --from csv` — convert CSV (first row = header). - `python scripts/run.py data.tsv --from csv --delimiter $'\t'` — TSV input. - `cat table.md | python scripts/run.py -` — read from stdin. Output is a fully aligned Markdown table on stdout. ## Pitfalls - For `--from md`, the second line must be a real separator row (`---`, `:--`, `--:`, `:-:`); otherwise it errors. - Ragged rows are padded with empty cells to the widest row. - Column alignment from the separator row is preserved; CSV input defaults to left alignment.
Markdown Table Formatter by langbot-team
Align and prettify a Markdown table, or convert CSV into a Markdown table with aligned columns.
Loading...