# Md Tables

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

- Skill: `majiayu000/md-tables-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/md-tables-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/md-tables-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/md-tables-2

---


---
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, table alignment, table formatting, md table, align columns.
---

# Markdown Table Formatting

## Overview

This skill provides a Python script (`fix-md-tables.py`) to fix markdown table alignment and spacing issues. It normalizes column widths, ensures consistent cell padding, and handles separator row alignment markers.

## Features

- Aligns columns to consistent widths
- Normalizes cell spacing with single-space padding
- Preserves alignment markers (`:---`, `:---:`, `---:`)
- Handles tables with varying column counts
- Adds blank lines around tables when needed

## Usage

Run the script located in this skill's directory:

```bash
# Preview fixed output
python fix-md-tables.py document.md

# Fix tables in-place
python fix-md-tables.py document.md --in-place
python fix-md-tables.py document.md -i
```

## Example

### Before

```markdown
|Name|Age|City|
|---|---|---|
|Alice|30|New York|
|Bob|25|Los Angeles|
```

### After

```markdown
| Name  | Age | City        |
| ----- | --- | ----------- |
| Alice | 30  | New York    |
| Bob   | 25  | Los Angeles |
```

## Alignment Markers

The script preserves alignment markers in separator rows:

| Syntax  | Alignment      |
| ------- | -------------- |
| `---`   | Left (default) |
| `:---`  | Left           |
| `---:`  | Right          |
| `:---:` | Center         |

