Formats markdown tables with fixed-width columns for consistent alignment. Use when creating tables, reformatting existing tables, or ensuring table readability. Triggers on terms like "format table", "align table", "fix table", "table columns", "markdown table".
Markdown tables MUST use fixed-width columns with space padding. This is mandatory for readability in plain text editors and diffs.
| Size | succinctly | jq | Speedup |
|----------|---------------------|---------------------|------------|
| **10KB** | 2.2 ms (4.3 MiB/s) | 4.1 ms (2.3 MiB/s) | **1.86x** |
| **1MB** | 24.5 ms (33 MiB/s) | 44 ms (18 MiB/s) | **1.79x** |
| Size | succinctly | jq | Speedup |
|------|------------|-----|---------|
| **10KB** | 2.2 ms (4.3 MiB/s) | 4.1 ms (2.3 MiB/s) | **1.86x** |
| and before | for readability in data rows|------|---------| with dashes matching column widths| - |For each column:
1. width = max(len(cell) for cell in column)
2. width = max(width, 3) # Minimum 3 chars for separator
For each row:
1. For each cell:
- Pad content to column width
- Add single space before and after content
2. Join cells with '|' delimiter
3. Add '|' at start and end
When using bold (**text**) in table cells:
Spaces must be OUTSIDE the bold markers, not inside:
<!-- CORRECT: Spaces outside ** -->
| **59.6ms** |
<!-- WRONG: Spaces inside ** (markdown won't render bold) -->
| ** 59.6ms** |
This is important for right-aligned numeric columns where padding is added.
| Alignment | Separator Format | Example |
|---|---|---|
| Left | ` | ---------- |
| Right | ` | ---------: |
| Center | ` | :--------: |
For tables with many columns or very long content:
| Name | Type | Size | Description |
|------------|--------|---------|--------------------------------------|
| ib | Vec | ~N bits | Interest bits marking structural |
| | | | characters and value starts |
| bp | Vec | ~N bits | Balanced parens encoding tree |
| | | | structure |
Consider:
When formatting tables:
: markers for right/center alignment