prettier-plugin-compact-markdown-table
v0.1.0
Published
Prettier plugin for compact markdown tables without cell padding or alignment
Downloads
116
Maintainers
Readme
prettier-plugin-compact-markdown-table
Prettier plugin for compact markdown tables without cell padding or alignment
Resolves prettier/prettier#12074, prettier/prettier#14722, prettier/prettier#16954.
Features
- Compact tables: Strip all whitespace padding or alignment and reduce separators for table cells.
- Save LLM tokens: A 5-column, 10-row table saves ~21% of table tokens and ~32% of characters with compact formatting.
- Fit character limits: Useful for submissions with strict character budgets, e.g., OpenReview rebuttals capped at 5000 characters.
Prerequisites
- Prettier >= 3.0.0
Get Started
Install the plugin alongside Prettier:
# npm
npm install -D prettier-plugin-compact-markdown-table
# pnpm
pnpm add -D prettier-plugin-compact-markdown-tableAdd the plugin to your .prettierrc:
{
"plugins": ["prettier-plugin-compact-markdown-table"]
}Then format as usual:
prettier --write "**/*.md"Before:
| Name | Age | City |
| ----- | --- | ---- |
| Alice | 30 | NYC |
| Bob | 25 | LA |After:
|Name|Age|City|
|-|-|-|
|Alice|30|NYC|
|Bob|25|LA|Config
tableLayout
|Value|Description|
|-|-|
|"compact" (default)|No cell padding, minimal separators.|
|"aligned"|Pad cells to align columns (Prettier default).|
Set in .prettierrc:
{
"tableLayout": "compact"
}Or pass via CLI:
prettier --table-layout aligned --write "**/*.md"Licenses
Copyright (C) 2026 Yulong Ming [email protected]
Apache License, Version 2.0
