AgentSkillsCN

md-tables

修复 Markdown 表格的对齐与间距问题。适用于在 Markdown 文件中格式化表格、对齐列、规范单元格内边距,或确保表格结构的完整性。触发关键词:markdown 表格、md 表格、表格格式化、列对齐、管道表、GFM 表格、表格生成器、对齐列、表格间距、表格布局、修复表格、格式化表格、表格结构。

SKILL.md
--- frontmatter
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

bash
# 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:

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

Configuration tables:

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

Right-aligned numbers:

markdown
| 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

SyntaxAlignment
---Left (default)
:---Left
---:Right
:---:Center