---
name: markdown-table-generator
description: "Turns messy pasted data into a clean Markdown table with your choice of alignment, header handling, and treatment of missing values. Use when a user has CSV, a list, or messy text and needs a Markdown table for a README, doc, or chat. Do not use for analysing the data or building a spreadsheet. Related topics: writing, utility, data."
---

# Markdown Table Generator

Turns messy pasted data into a clean Markdown table with your choice of alignment, header handling, and treatment of missing values.

## When to use

Use this skill when a user has CSV, a list, or messy text and needs a Markdown table for a README, doc, or chat. Do not use it for analysing the data or building a spreadsheet.

## Workflow

1. Ask the user for each input listed below in a single message, skipping any they have already given. Where options are listed, offer them, but accept other answers too.
2. Identify the delimiter and the column count, and note them in one line.
3. Set the header row from the first row, or write short headers when it has none.
4. Fill missing values by the chosen rule and escape any pipe characters inside cells.
5. Apply the alignment, add the numbering column if asked, and output the table in a code block.
6. List any rows that needed padding or any choice you made about ambiguous data.

## Inputs

- **Raw data** (longer free text)
- **First row contains headers** (choose one: Yes, No)
- **Column alignment** (choose one: Left-aligned, Center-aligned, Right-aligned, Auto)
- **Missing values** (choose one: Leave blank, Fill with N/A, Fill with a dash)
- **Add a numbering column** (choose one: Yes, No)

## Output

A Markdown table in a code block with the requested alignment, followed by a short note on padded rows or ambiguities.

## Prompt template

Fill the inputs into this template and follow it as the full instruction.

### Markdown Table Formatter

Format the data below as a clean Markdown table.

- Raw data: {{Raw data}}
- First row contains headers: {{First row contains headers}}
- Column alignment: {{Column alignment}}
- Missing values: {{Missing values}}
- Add a numbering column: {{Add a numbering column}}

First identify the delimiter and the number of columns, and say so in one line. If the first row is not headers, create short descriptive headers. Keep every value exactly as given, without rewording or rounding, and trim only stray whitespace. Escape any pipe characters inside cells. With Auto alignment, right-align numeric columns and left-align the rest. If a row has the wrong number of cells, pad it using the missing value rule and list those rows afterward.

Return the table in a code block, then a short note listing any rows that were padded or any ambiguity you resolved.

## Pitfalls

- Rewording or rounding values while tidying them.
- Splitting a cell at a comma inside a quoted value.
- Forgetting to escape a pipe character, which breaks the table.
