Format markdown tables in a file so columns align.
With uv — install as a global CLI tool:
uv tool install .Editable / dev:
uv pip install -e .Run without installing:
uvx --from . fmt-md-tables FILEFrom PyPI (once published):
uv tool install fmt-md-tablesfmt-md-tables FILE # print formatted output to stdout
fmt-md-tables FILE1 FILE2 ... # process many files (concatenated to stdout)
fmt-md-tables -i FILE1 FILE2 ... # rewrite each file in place
fmt-md-tables - # read from stdin- Pads cells to max column width per table.
- Preserves alignment markers (
:---,:---:,---:). - Skips fenced code blocks (``` and
~~~). - Handles escaped pipes (
\|). - Pads short rows with empty cells.
Input:
| Filter | Index plan | Notes |
|--------|-----------|-------|
| `Filter::eq("col", val)` | Exact match | Best case |
| `Filter::ge("col", val)` | Range scan (start bound) | Uses linked-leaf traversal |Output:
| Filter | Index plan | Notes |
| ------------------------ | ------------------------ | -------------------------- |
| `Filter::eq("col", val)` | Exact match | Best case |
| `Filter::ge("col", val)` | Range scan (start bound) | Uses linked-leaf traversal |MIT