> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdoc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# create.table

> Create a new table at the target position.

## Summary

Create a new table at the target position.

* Operation ID: `create.table`
* API member path: `editor.doc.create.table(...)`
* Mutates document: `yes`
* Idempotency: `non-idempotent`
* Supports tracked mode: `yes`
* Supports dry run: `yes`
* Deterministic target resolution: `yes`

## Expected result

Returns a CreateTableResult with the new table block ID and address.

## Input fields

| Field | Type | Required | Description |
| - | - | - | - |
| `at` | object(kind="documentStart") \| object(kind="documentEnd") \| object(kind="before") \| object(kind="after") \| object(kind="before") \| object(kind="after") | no | One of: object(kind="documentStart"), object(kind="documentEnd"), object(kind="before"), object(kind="after"), object(kind="before"), object(kind="after") |
| `columns` | integer | yes | |
| `rows` | integer | yes | |

### Example request

```json theme={null}
{
  "at": {
    "kind": "documentStart"
  },
  "columns": 1,
  "rows": 1
}
```

## Output fields

### Variant 1 (success=true)

| Field | Type | Required | Description |
| - | - | - | - |
| `success` | `true` | yes | Constant: `true` |
| `table` | TableAddress | yes | TableAddress |
| `table.kind` | `"block"` | yes | Constant: `"block"` |
| `table.nodeId` | string | yes | |
| `table.nodeType` | `"table"` | yes | Constant: `"table"` |
| `trackedChangeRefs` | EntityAddress\[] | no | |

### Variant 2 (success=false)

| Field | Type | Required | Description |
| - | - | - | - |
| `failure` | object | yes | |
| `failure.code` | enum | yes | `"NO_OP"`, `"INVALID_TARGET"`, `"TARGET_NOT_FOUND"`, `"CAPABILITY_UNAVAILABLE"` |
| `failure.details` | any | no | |
| `failure.message` | string | yes | |
| `success` | `false` | yes | Constant: `false` |

> [!TIP]
>
> On success, `result.table` is the created table address. Reuse `result.table.nodeId` for follow-up table operations in the same session.

### Example response

```json theme={null}
{
  "success": true,
  "table": {
    "kind": "block",
    "nodeId": "node-def456",
    "nodeType": "table"
  },
  "trackedChangeRefs": [
    {
      "entityId": "entity-789",
      "entityType": "comment",
      "kind": "entity"
    }
  ]
}
```

## Pre-apply throws

* `TARGET_NOT_FOUND`
* `INVALID_TARGET`
* `CAPABILITY_UNAVAILABLE`
* `INVALID_TARGET`
* `AMBIGUOUS_TARGET`

## Non-applied failure codes

* `INVALID_TARGET`

## Raw schemas

> [accordion] Raw input schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "at": {
>       "oneOf": [
>         {
>           "additionalProperties": false,
>           "properties": {
>             "kind": {
>               "const": "documentStart"
>             }
>           },
>           "required": [
>             "kind"
>           ],
>           "type": "object"
>         },
>         {
>           "additionalProperties": false,
>           "properties": {
>             "kind": {
>               "const": "documentEnd"
>             }
>           },
>           "required": [
>             "kind"
>           ],
>           "type": "object"
>         },
>         {
>           "additionalProperties": false,
>           "properties": {
>             "kind": {
>               "const": "before"
>             },
>             "target": {
>               "$ref": "#/$defs/BlockNodeAddress"
>             }
>           },
>           "required": [
>             "kind",
>             "target"
>           ],
>           "type": "object"
>         },
>         {
>           "additionalProperties": false,
>           "properties": {
>             "kind": {
>               "const": "after"
>             },
>             "target": {
>               "$ref": "#/$defs/BlockNodeAddress"
>             }
>           },
>           "required": [
>             "kind",
>             "target"
>           ],
>           "type": "object"
>         },
>         {
>           "additionalProperties": false,
>           "properties": {
>             "kind": {
>               "const": "before"
>             },
>             "nodeId": {
>               "type": "string"
>             }
>           },
>           "required": [
>             "kind",
>             "nodeId"
>           ],
>           "type": "object"
>         },
>         {
>           "additionalProperties": false,
>           "properties": {
>             "kind": {
>               "const": "after"
>             },
>             "nodeId": {
>               "type": "string"
>             }
>           },
>           "required": [
>             "kind",
>             "nodeId"
>           ],
>           "type": "object"
>         }
>       ]
>     },
>     "columns": {
>       "minimum": 1,
>       "type": "integer"
>     },
>     "rows": {
>       "minimum": 1,
>       "type": "integer"
>     }
>   },
>   "required": [
>     "rows",
>     "columns"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Raw output schema
>
> ```json theme={null}
> {
>   "oneOf": [
>     {
>       "additionalProperties": false,
>       "properties": {
>         "success": {
>           "const": true
>         },
>         "table": {
>           "$ref": "#/$defs/TableAddress"
>         },
>         "trackedChangeRefs": {
>           "items": {
>             "$ref": "#/$defs/EntityAddress"
>           },
>           "type": "array"
>         }
>       },
>       "required": [
>         "success",
>         "table"
>       ],
>       "type": "object"
>     },
>     {
>       "additionalProperties": false,
>       "properties": {
>         "failure": {
>           "additionalProperties": false,
>           "properties": {
>             "code": {
>               "enum": [
>                 "NO_OP",
>                 "INVALID_TARGET",
>                 "TARGET_NOT_FOUND",
>                 "CAPABILITY_UNAVAILABLE"
>               ]
>             },
>             "details": {},
>             "message": {
>               "type": "string"
>             }
>           },
>           "required": [
>             "code",
>             "message"
>           ],
>           "type": "object"
>         },
>         "success": {
>           "const": false
>         }
>       },
>       "required": [
>         "success",
>         "failure"
>       ],
>       "type": "object"
>     }
>   ]
> }
> ```

> [accordion] Raw success schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "success": {
>       "const": true
>     },
>     "table": {
>       "$ref": "#/$defs/TableAddress"
>     },
>     "trackedChangeRefs": {
>       "items": {
>         "$ref": "#/$defs/EntityAddress"
>       },
>       "type": "array"
>     }
>   },
>   "required": [
>     "success",
>     "table"
>   ],
>   "type": "object"
> }
> ```

> [accordion] Raw failure schema
>
> ```json theme={null}
> {
>   "additionalProperties": false,
>   "properties": {
>     "failure": {
>       "additionalProperties": false,
>       "properties": {
>         "code": {
>           "enum": [
>             "NO_OP",
>             "INVALID_TARGET",
>             "TARGET_NOT_FOUND",
>             "CAPABILITY_UNAVAILABLE"
>           ]
>         },
>         "details": {},
>         "message": {
>           "type": "string"
>         }
>       },
>       "required": [
>         "code",
>         "message"
>       ],
>       "type": "object"
>     },
>     "success": {
>       "const": false
>     }
>   },
>   "required": [
>     "success",
>     "failure"
>   ],
>   "type": "object"
> }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.