# ASCII table generator

Render headers and rows as a box-drawing or plain ASCII table for terminals, logs and code comments.

- Endpoint: `POST https://setget.net/v1/tools/ascii-table` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `ascii-table`
- Page: https://setget.net/tools/ascii-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.
- `style` (optional, string, one of `box`, `rounded`, `double`, `ascii`, default `"box"`): Border style. ascii uses only + - and | for places that cannot show box-drawing characters.
- `align_numbers` (optional, boolean, default `true`): Right-align columns that hold only numbers.
- `max_width` (optional, integer, default `60`, range 5..200): Longest cell in characters; longer text is cut with an ellipsis.

## Example 1

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

Result:

```json
{"text":"┌──────┬─────┐\n│ Name │ Age │\n├──────┼─────┤\n│ Sam  │  31 │\n│ Alex │  27 │\n└──────┴─────┘","rows":2,"columns":2,"width":14}
```

## Example 2: Plain ASCII borders

```json
{"input":{"headers":["Name","Age"],"rows":[["Sam",31],["Alex",27]],"style":"ascii"}}
```

Result:

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

**The borders look broken. Why?** Box-drawing characters need a monospaced font and UTF-8. Choose the ascii style where that is not available.
