md-tables

cosmix 的头像作者 cosmix

修复markdown表格对齐和间距问题。在格式化markdown文件中的表格、对齐列、标准化单元格填充或确保适当表格结构时使用。触发条件:markdown表格、表格对齐、表格格式化、md表格、对齐列。

📖 中文导读:修复markdown表格对齐和间距问题。在格式化markdown文件中的表格、对齐列、标准化单元格填充或确保适当表格结构时使用。触发条件:markdown表格、表格对齐、表格格式化、md表格、对齐列。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: md-tables description: Fix markdown table alignment and spacing issues. Use when formatting tables in markdown files, aligning columns, normalizing cell padding, or ensuring proper table structure. Triggers: markdown table, md table, table formatting, column alignment, pipe table, GFM table, table generator, align columns, table spacing, table layout, fix table, format table, table structure.

Markdown Table Formatting

Utility for fixing markdown table alignment and spacing. Normalizes column widths, ensures consistent padding, and preserves alignment markers.

Quick Examples

# Preview fixed output
python fix-md-tables.py document.md

# Fix in-place
python fix-md-tables.py document.md -i

Common Patterns

Status tables:

| Stage    | Status    | Branch       |
| -------- | --------- | ------------ |
| build    | Complete  | loom/build   |
| test     | Executing | loom/test    |

Configuration tables:

| Option      | Default | Description           |
| ----------- | ------- | --------------------- |
| timeout     | 300     | Session timeout (sec) |
| auto_merge  | false   | Enable auto merging   |

Right-aligned numbers:

| Item  | Count | Total |
| ----- | ----: | ----: |
| Files |    42 |   500 |
| Lines | 1,234 | 5,000 |

Features

  • Aligns columns to consistent widths
  • Single-space padding for cells
  • Preserves alignment markers (:---, :---:, ---:)
  • Adds blank lines around tables

Alignment Markers

Syntax Alignment
--- Left (default)
:--- Left
---: Right
:---: Center