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

# Types: editor: Tables

## `CellState`

The cell under the focus, for table toolbars. Chrome reports direct
properties only (`w:tcPr`, `w:trPr`), in the shape the write commands take.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `borders` | `CellBorders` | Direct `w:tcBorders`: a border, `false` for nil, absent when the table decides. |
| `cantSplit` | `boolean` | `w:cantSplit`: the row never breaks across pages. |
| `col` | `number` | Grid column index and width of the cell's first column. |
| `columnWidthPt` | `number \| undefined` | |
| `marginsPt` | `CellMarginsPt` | Direct `w:tcMar`; an absent side inherits the table's. |
| `merged` | `boolean` | The cell spans more than one grid column or row, so it can be split. |
| `repeatHeader` | `boolean` | |
| `rowHeightPt` | `number \| undefined` | |
| `rowHeightRule` | `"atLeast" \| "exact"` | Meaningful with `rowHeightPt`; `atLeast` when the row carries no rule. |
| `shading` | `string \| undefined` | RRGGBB direct fill; undefined when none. |
| `table` | `TableState` | |
| `textDirection` | `CellTextDirection` | |
| `verticalAlignment` | `CellVerticalAlignment` | |

## `NavRow`

One outline row: the heading, its indent, and what the twisty does.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `active` | `boolean` | |
| `collapsed` | `boolean` | |
| `depth` | `number` | |
| `entry` | `OutlineEntry` | |
| `hasChildren` | `boolean` | |

## `PastedCell`

A pasted cell at its grid column; a span merges the columns and rows after it.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `col` | `number` | |
| `colSpan?` | `number` | |
| `paragraphs` | `PastedParagraph[]` | |
| `rowSpan?` | `number` | |

## `TableCommand`

Structural table edits act on the table that holds the selection focus;
`tableMergeCells` needs a cell rectangle (see `cellRange`).

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type TableCommand = { kind: "tableInsertRow"; position: "above" | "below" } | { kind: "tableInsertColumn"; position: "before" | "after" } | { kind: "tableDeleteRow" } | { kind: "tableDeleteColumn" } | { kind: "tableDeleteCells"; shift: "left" | "up" } | { kind: "tableDelete" } | { kind: "tableMergeCells" } | { backward: boolean; kind: "tableTab" } | { format: TableCellFormat; kind: "tableCellFormat" } | { kind: "tableBorders"; pen?: CellBorder; preset: BorderPreset } | { format: TableRowFormat; kind: "tableRowFormat"; row?: number } | { format: TableFormat; kind: "tableFormat" } | { kind: "tableSplitCell" } | { col?: number; kind: "tableColumnWidth"; widthPt: number } | { col: number; deltaPt: number; kind: "tableColumnBorder"; row: number } | { kind: "tableDistributeColumns" } | { kind: "tableDistributeRows" } | { kind: "tableSplit" } | { kind: "tableToText"; separator?: string } | { caseSensitive?: boolean; headerRow?: boolean; keys: TableSortKey[]; kind: "tableSort" }
```

## `TableState`

Direct table-level properties of the focus cell's table.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `alignment` | `TableAlignment` | |
| `borders` | `TableBorders` | Direct `w:tblBorders`, in the write model: a border, `false` for nil, absent when the style decides. |
| `defaultCellMarginsPt` | `CellMarginsPt` | Direct `w:tblCellMar`; an absent side inherits. |
| `indentPt` | `number \| undefined` | |
| `layout` | `TableLayout` | |
| `look` | `Required<TableLook>` | Which conditional regions of the style show (`w:tblLook`), Word's defaults when absent. |
| `position?` | `TablePosition` | The float's placement, with every side of `distancePt` filled in; absent when `wrap` is `none`. |
| `styleId` | `string \| undefined` | |
| `width` | `{ kind: "auto" } \| { kind: "pt"; pt: number } \| { kind: "pct"; pct: number }` | |
| `wrap` | `"none" \| "around"` | Word's text wrapping: `around` is a floating table (`w:tblpPr`), `none` sits in the flow. |

## `TableStyleBorders`

RRGGBB per side; `null` is an explicit nil that clears the side below it.

Not exported by name. You get it from the API.

```ts theme={null}
type TableStyleBorders = Partial<Record<"top" | "left" | "bottom" | "right" | "insideH" | "insideV", string | null>>
```

## `TableStyleLook`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type TableStyleLook = Partial<Record<TableStyleRegionName, TableStyleRegion>>
```

## `TableStyleRegion`

What one table-style region paints: RRGGBB fill and text colour, bold, borders.

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

| Name | Type | Description |
| - | - | - |
| `bold?` | `boolean` | |
| `borders?` | `TableStyleBorders` | |
| `color?` | `string` | |
| `fill?` | `string` | |

## `TableStyleRegionName`

Import from `@reductoai/docx-editor`, `@reductoai/docx-editor/model`.

```ts theme={null}
type TableStyleRegionName = "wholeTable" | "firstRow" | "lastRow" | "firstCol" | "lastCol" | "band1Horz" | "band1Vert"
```
