Claude-skill-registry-data md-table-formatter

Automatically formats Markdown tables with proper column alignment after file edits. Use when working with Markdown files containing tables.

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry-data
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry-data "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/md-table-formatter" ~/.claude/skills/majiayu000-claude-skill-registry-data-md-table-formatter && rm -rf "$T"
manifest: data/md-table-formatter/SKILL.md
source content

Markdown Table Formatter

Automatically formats Markdown tables with proper column alignment.

Features

  • Auto-formatting - Tables are formatted after Write/Edit operations on .md files
  • Alignment support - Left (
    :---
    ), center (
    :---:
    ), and right (
    ---:
    )
  • Unicode aware - Handles emoji and CJK characters correctly
  • Code preservation - Preserves markdown inside inline code blocks

How It Works

The PostToolUse hook triggers after file edits:

  1. Detects if the file is Markdown (.md, .mdx)
  2. Parses all tables in the file
  3. Calculates column widths (accounting for hidden markdown symbols)
  4. Pads cells for alignment
  5. Writes formatted content back

Table Syntax

| Left | Center | Right |
|:-----|:------:|------:|
| A    |   B    |     C |

Requirements

For best results with CJK/emoji characters:

pip install wcwidth