# Markdown table generator

Build a Markdown table from headers and rows, padded so the columns also line up as plain text.

- Endpoint: `POST https://setget.net/v1/tools/markdown-table` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `markdown-table`
- Page: https://setget.net/tools/markdown-table

## Inputs

- `rows` (required, json): The rows: a list of lists, or a list of objects keyed by column name.
- `headers` (optional, array): Column names. Leave out to use the object keys, or the first row.
- `align` (optional, array): Alignment: left, center, right or none. One value for every column, or one per column.

## Example 1

```json
{"input":{"headers":["Name","Age"],"rows":[["Sam",31],["Alex",27]],"align":["left","right"]}}
```

Result:

```json
{"text":"| Name | Age |\n| :--- | --: |\n| Sam  |  31 |\n| Alex |  27 |","rows":2,"columns":2}
```

## Example 2: Objects as rows; the pipe character is escaped

```json
{"input":{"rows":[{"tool":"a|b","ok":true}]}}
```

Result:

```json
{"text":"| tool | ok   |\n| ---- | ---- |\n| a\\|b | true |","rows":1,"columns":2}
```

**Why pad the cells?** Markdown ignores the extra spaces, but padded tables are far easier to read and edit as plain text.
