Markdown table generator

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

Input

The rows: a list of lists, or a list of objects keyed by column name.
Column names. Leave out to use the object keys, or the first row.
Alignment: left, center, right or none. One value for every column, or one per column.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/markdown-table \
  -H 'Content-Type: application/json' \
  -d '{"input":{"headers":["Name","Age"],"rows":[["Sam",31],["Alex",27]],"align":["left","right"]}}'
import json, urllib.request

body = {'input': {'headers': ['Name', 'Age'], 'rows': [['Sam', 31], ['Alex', 27]], 'align': ['left', 'right']}}
request = urllib.request.Request("https://setget.net/v1/tools/markdown-table", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/markdown-table", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"headers":["Name","Age"],"rows":[["Sam",31],["Alex",27]],"align":["left","right"]}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "markdown-table",
  "input": {
    "headers": [
      "Name",
      "Age"
    ],
    "rows": [
      [
        "Sam",
        31
      ],
      [
        "Alex",
        27
      ]
    ],
    "align": [
      "left",
      "right"
    ]
  }
}
{
  "input": {
    "headers": [
      "Name",
      "Age"
    ],
    "rows": [
      [
        "Sam",
        31
      ],
      [
        "Alex",
        27
      ]
    ],
    "align": [
      "left",
      "right"
    ]
  }
}

Endpoint: POST /v1/tools/markdown-table. Over MCP: run_tool with slug: "markdown-table". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
rows json yes The rows: a list of lists, or a list of objects keyed by column name.
headers array no Column names. Leave out to use the object keys, or the first row.
align array no Alignment: left, center, right or none. One value for every column, or one per column.

Examples

Input
{
  "headers": [
    "Name",
    "Age"
  ],
  "rows": [
    [
      "Sam",
      31
    ],
    [
      "Alex",
      27
    ]
  ],
  "align": [
    "left",
    "right"
  ]
}
Result
{
  "text": "| Name | Age |\n| :--- | --: |\n| Sam  |  31 |\n| Alex |  27 |",
  "rows": 2,
  "columns": 2
}

Objects as rows; the pipe character is escaped

Input
{
  "rows": [
    {
      "tool": "a|b",
      "ok": true
    }
  ]
}
Result
{
  "text": "| tool | ok   |\n| ---- | ---- |\n| a\\|b | true |",
  "rows": 1,
  "columns": 2
}

Questions

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