---
title: "table.create: Insert a table — Note kit command — Kition"
description: "Inserts a new table of `columns` columns (with optional header cells and `rows` empty body rows) before a line, at a section position, or at the end of the note, and answers its table index."
canonical: "https://developer.kition.ai/docs/kits/note/commands/table.create"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/note/commands/table.create](https://developer.kition.ai/docs/kits/note/commands/table.create)

# table.create

**Insert a table.** Inserts a new table of `columns` columns (with optional header cells and `rows` empty body rows) before a line, at a section position, or at the end of the note, and answers its table index.

- Kit: Note 0.3.0 (Markdown (.md)); reference: [Note kit commands](https://developer.kition.ai/docs/kits/note.md)
- Changes the document: yes

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `columns` | `integer (≥ 1, ≤ 64)` | yes | How many columns. |
| `header` | `string[]` | no | The header cells. |
| `heading` | `string[]` | no | Or a heading's path, with position. |
| `line` | `integer` | no | Insert before this line, from 1. |
| `position` | `"before" \| "after" \| "start" \| "end"` | no | Where, relative to the heading's section; end by default. |
| `rows` | `integer` | no | How many empty body rows (default 1). |

## Call through note_run

```text
note_run {
  "path": "<file>.md",
  "steps": [{ "command": "table.create", "params": { "columns": <integer> } }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `header`, `heading`, `line`, `position`, `rows`. note_run answers the step’s result in `completed[i].result`.

## Result

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `changed` | `boolean` | yes | Whether the note's text changed. |
| `table` | `integer` | yes | The new table's index, from 0. |

```json
{
  "additionalProperties": false,
  "properties": {
    "changed": {
      "description": "Whether the note's text changed.",
      "type": "boolean"
    },
    "table": {
      "description": "The new table's index, from 0.",
      "type": "integer"
    }
  },
  "required": [
    "changed",
    "table"
  ],
  "type": "object"
}
```

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "columns": {
      "description": "How many columns.",
      "maximum": 64,
      "minimum": 1,
      "type": "integer"
    },
    "header": {
      "description": "The header cells.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "heading": {
      "description": "Or a heading's path, with position.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "line": {
      "description": "Insert before this line, from 1.",
      "type": "integer"
    },
    "position": {
      "description": "Where, relative to the heading's section; end by default.",
      "enum": [
        "before",
        "after",
        "start",
        "end"
      ],
      "type": "string"
    },
    "rows": {
      "description": "How many empty body rows (default 1).",
      "type": "integer"
    }
  },
  "required": [
    "columns"
  ],
  "type": "object"
}
```

Generated from kition-sdk packages/script/kits/note.ts and the kit itself (kition-note@69e14d9).
