# FBoardTable

- Human documentation: [https://docs.univer.ai/reference/facade/board-table](https://docs.univer.ai/reference/facade/board-table)

- Agent Markdown: [https://docs.univer.ai/reference/facade/board-table.md](https://docs.univer.ai/reference/facade/board-table.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [facade/board-table.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/facade/board-table.mdx)

---

Facade for one Board table element and its table resource.

Instances are returned by `FBoard` table mixin methods. Do not construct this class directly because it needs the
active Board model, table resource service, and command service.

## Access

Access through:

* [`FBoard.insertTable()`](https://docs.univer.ai/reference/facade/board.md#inserttable)
* [`FBoard.getTable()`](https://docs.univer.ai/reference/facade/board.md#gettable)
* [`FBoard.getTables()`](https://docs.univer.ai/reference/facade/board.md#gettables)

## Setup

Register [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) or a preset that includes it. In plugin mode, import `@univerjs-pro/boards-table/facade`. Additional methods below require their listed plugin packages. See [Facade setup](https://docs.univer.ai/guides/boards/getting-started/facade.md).

## `@univerjs-pro/boards-table`

### `FBoardTable.deleteColumns`

Deletes an inclusive column range.

```typescript
deleteColumns(startColumn: number, endColumn: number): boolean
```

**Parameters**

* `startColumn` — Required. First zero-based column to delete.
* `endColumn` — Required. Last zero-based column to delete.

**Returns**

`true` when the command succeeds.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 4 })
if (!table || !table.deleteColumns(1, 2)) throw new Error('Cannot delete columns')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.deleteRows`

Deletes an inclusive row range.

```typescript
deleteRows(startRow: number, endRow: number): boolean
```

**Parameters**

* `startRow` — Required. First zero-based row to delete.
* `endRow` — Required. Last zero-based row to delete.

**Returns**

`true` when the command succeeds.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 4, columns: 3 })
if (!table || !table.deleteRows(1, 2)) throw new Error('Cannot delete rows')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getCellInfo`

Gets plain text, rich text, style, and merge information for one cell.

```typescript
getCellInfo(row: number, column: number): IBoardTableFacadeCellInfo | null
```

**Parameters**

* `row` — Required. Zero-based row index.
* `column` — Required. Zero-based column index.

**Returns**

Detached cell information, or `null` when the coordinates or table resource are invalid.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getCellInfo(0, 0))
```

**Types:** [`IBoardTableFacadeCellInfo`](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getCellRichText`

Gets one cell as a detached rich-text value.

The returned value can be copied or transformed safely before calling `setCellRichText()`. It never exposes the
mutable table resource snapshot.

```typescript
getCellRichText(row: number, column: number): RichTextValue | null
```

**Parameters**

* `row` — Required. Zero-based row index.
* `column` — Required. Zero-based column index.

**Returns**

Detached rich-text value, or `null` when the table or cell does not exist.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getCellRichText(0, 0)?.getData())
```

**Types:** [`RichTextValue`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/docs/data-model/rich-text-builder.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getCellStyle`

Gets a detached style snapshot for one cell.

```typescript
getCellStyle(row: number, column: number): ISlideTableCellStyle | null
```

**Parameters**

* `row` — Required. Zero-based row index.
* `column` — Required. Zero-based column index.

**Returns**

A cloned style object, or `null` when the cell has no explicit style or does not exist.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getCellStyle(0, 0))
```

**Types:** [`ISlideTableCellStyle`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getData`

Gets a clone of the raw table resource snapshot.

Agent scripts normally prefer `getValues()` and explicit mutation methods rather than depending on table internals.

```typescript
getData(): ISlideTableSnapshot | null
```

**Returns**

Table resource data, or `null` when it is unavailable.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getData())
```

**Types:** [`ISlideTableSnapshot`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getId`

Gets the generated Board element id.

Prefer `getId()` for agent references; this id is only useful for integration event payloads.

```typescript
getId(): string
```

**Returns**

Generated table host element id.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getId())
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getRichTextValues`

Gets a rectangular matrix of detached rich-text cell values.

Omit `range` to read the complete table. The returned values are independent of the resource snapshot and can be
transformed before being written with `setRichTextValues()`.

```typescript
getRichTextValues(range?: ISlideTableCellRange): RichTextValue[][]
```

**Parameters**

* `range` — Optional. Optional inclusive zero-based range.

**Returns**

A rectangular rich-text matrix, or an empty array when the table or range is invalid.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getRichTextValues({ startRow: 0, endRow: 1, startColumn: 0, endColumn: 1 }))
```

**Types:** [`RichTextValue`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/docs/data-model/rich-text-builder.d.ts) · [`ISlideTableCellRange`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getStructure`

Gets a detached structural summary of this table.

```typescript
getStructure(): IBoardTableFacadeStructure | null
```

**Returns**

Row/column counts, sizes, and merged ranges, or `null` when the table resource is unavailable.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getStructure())
```

**Types:** [`IBoardTableFacadeStructure`](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getTableId`

Gets the table resource id.

```typescript
getTableId(): string | null
```

**Returns**

Generated table resource id, or `null` when the host table no longer exists.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getTableId())
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.getValues`

Gets the current plain-text values in row and column order.

```typescript
getValues(): string[][]
```

**Returns**

A rectangular matrix. Empty cells are returned as empty strings.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table) throw new Error('Cannot insert table')
console.log(table.getValues())
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.insertColumns`

Inserts columns and grows the Board host element in the same undoable command.

```typescript
insertColumns(columnIndex: number, count?: number, width?: number): boolean
```

**Parameters**

* `columnIndex` — Required. Zero-based insertion index.
* `count` — Optional. Default: `1`. Number of columns to insert. Defaults to `1`.
* `width` — Optional. Optional width in board units for each new column.

**Returns**

`true` when the command succeeds.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table || !table.insertColumns(1, 2)) throw new Error('Cannot insert columns')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.insertRows`

Inserts rows and grows the Board host element in the same undoable command.

```typescript
insertRows(rowIndex: number, count?: number, height?: number): boolean
```

**Parameters**

* `rowIndex` — Required. Zero-based insertion index.
* `count` — Optional. Default: `1`. Number of rows to insert. Defaults to `1`.
* `height` — Optional. Optional height in board units for each new row.

**Returns**

`true` when the command succeeds.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table || !table.insertRows(1, 2)) throw new Error('Cannot insert rows')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.mergeCells`

Merges a supplied inclusive cell range.

```typescript
mergeCells(range: ISlideTableCellRange): boolean
```

**Parameters**

* `range` — Required. Inclusive zero-based range to merge.

**Returns**

`true` when the command succeeds or the range is already merged.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table || !table.mergeCells({ startRow: 0, endRow: 0, startColumn: 0, endColumn: 1 })) {
  throw new Error('Cannot merge cells')
}
```

**Types:** [`ISlideTableCellRange`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.moveColumns`

Moves an inclusive column range before or after a target column.

Cell content, rich text, style, merges, and column width move together through the shared table command.

```typescript
moveColumns(startColumn: number, endColumn: number, targetColumn: number, position: SlideTableMovePosition): boolean
```

**Parameters**

* `startColumn` — Required. First zero-based column to move.
* `endColumn` — Required. Last zero-based column to move.
* `targetColumn` — Required. Zero-based reference column.
* `position` — Required. Insert the moved columns `before` or `after` the reference column.

**Returns**

`true` when the move succeeds or is already in the requested position.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 4 })
if (!table || !table.moveColumns(0, 0, 2, 'after')) throw new Error('Cannot move column')
```

**Types:** [`SlideTableMovePosition`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/common/layout.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.moveRows`

Moves an inclusive row range before or after a target row.

Cell content, rich text, style, merges, and row height move together. Invalid overlaps are rejected by the shared
table layout command, while an equivalent update returns `true` without creating history.

```typescript
moveRows(startRow: number, endRow: number, targetRow: number, position: SlideTableMovePosition): boolean
```

**Parameters**

* `startRow` — Required. First zero-based row to move.
* `endRow` — Required. Last zero-based row to move.
* `targetRow` — Required. Zero-based reference row.
* `position` — Required. Insert the moved rows `before` or `after` the reference row.

**Returns**

`true` when the move succeeds or is already in the requested position.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 4, columns: 3 })
if (!table || !table.moveRows(0, 0, 2, 'after')) throw new Error('Cannot move row')
```

**Types:** [`SlideTableMovePosition`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/common/layout.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.remove`

Removes the Board table host element and its table resource.

```typescript
remove(): boolean
```

**Returns**

`true` when the removal command succeeds.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table || !table.remove()) throw new Error('Cannot remove table')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.resizeColumns`

Resizes an inclusive column range.

```typescript
resizeColumns(startColumn: number, endColumn: number, width: number): boolean
```

**Parameters**

* `startColumn` — Required. First zero-based column to resize.
* `endColumn` — Required. Last zero-based column to resize.
* `width` — Required. New column width in board units.

**Returns**

`true` when the command succeeds or the columns already have this width.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table || !table.resizeColumns(0, 1, 160)) throw new Error('Cannot resize columns')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.resizeRows`

Resizes an inclusive row range.

```typescript
resizeRows(startRow: number, endRow: number, height: number): boolean
```

**Parameters**

* `startRow` — Required. First zero-based row to resize.
* `endRow` — Required. Last zero-based row to resize.
* `height` — Required. New row height in board units.

**Returns**

`true` when the command succeeds or the rows already have this height.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table || !table.resizeRows(0, 1, 48)) throw new Error('Cannot resize rows')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.setBorderPreset`

Applies a border preset to a cell range.

```typescript
setBorderPreset(range: ISlideTableCellRange, preset: SlideTableBorderPresetEnum, border?: ISlideTableBorder): boolean
```

**Parameters**

* `range` — Required. Inclusive zero-based target range.
* `preset` — Required. Border preset enum value.
* `border` — Optional. Optional border appearance.

**Returns**

`true` when the command succeeds or the border is unchanged.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (
  !table ||
  !table.setBorderPreset(
    { startRow: 0, endRow: 2, startColumn: 0, endColumn: 2 },
    univerAPI.Enum.BoardTableBorderPresetEnum.All,
    { color: '#64748b', width: 1 },
  )
)
  throw new Error('Cannot set borders')
```

**Types:** [`ISlideTableCellRange`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts) · [`SlideTableBorderPresetEnum`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts) · [`ISlideTableBorder`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.setCellRichText`

Replaces one cell with rich text built by `univerAPI.newRichText()`.

The builder data is cloned before dispatch, so later changes to the builder do not mutate the table snapshot.
Use `setCellText()` for plain strings. Raw document data is reserved for advanced integrations.

```typescript
setCellRichText(row: number, column: number, richText: RichTextValue): boolean
```

**Parameters**

* `row` — Required. Zero-based row index.
* `column` — Required. Zero-based column index.
* `richText` — Required. Rich text value returned by `univerAPI.newRichText()`.

**Returns**

`true` when the command succeeds or the requested rich text is unchanged.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
const value = univerAPI.newRichText().bold('Approved')
if (!table || !table.setCellRichText(0, 0, value)) throw new Error('Cannot set rich text')
```

**Types:** [`RichTextValue`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/docs/data-model/rich-text-builder.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.setCellStyle`

Merges a style patch into a cell range.

```typescript
setCellStyle(range: ISlideTableCellRange, style: ISlideTableCellStyle): boolean
```

**Parameters**

* `range` — Required. Inclusive zero-based target range.
* `style` — Required. Cell style patch.

**Returns**

`true` when the command succeeds or the style is unchanged.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (
  !table ||
  !table.setCellStyle(
    { startRow: 0, endRow: 0, startColumn: 0, endColumn: 2 },
    { fill: { type: univerAPI.Enum.BoardTableFillTypeEnum.Solid, color: '#e0e7ff', alpha: 1 } },
  )
)
  throw new Error('Cannot style cells')
```

**Types:** [`ISlideTableCellRange`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts) · [`ISlideTableCellStyle`](https://unpkg.com/@univerjs-pro/slides-table@1.0.0-rc.0/lib/types/types.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.setCellText`

Replaces one cell with plain text.

```typescript
setCellText(row: number, column: number, text: string): boolean
```

**Parameters**

* `row` — Required. Zero-based row index.
* `column` — Required. Zero-based column index.
* `text` — Required. New plain text.

**Returns**

`true` when the command succeeds or the text is unchanged.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (!table || !table.setCellText(0, 0, 'Approved')) throw new Error('Cannot set cell text')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.setCellTextData`

Replaces one cell with raw Univer document data.

This is an advanced integration escape hatch. Application and agent code should prefer `setCellRichText()`.

```typescript
setCellTextData(row: number, column: number, textData: IDocumentData | null): boolean
```

**Parameters**

* `row` — Required. Zero-based row index.
* `column` — Required. Zero-based column index.
* `textData` — Required. Document data, or `null` to clear the cell.

**Returns**

`true` when the command succeeds or the requested data is unchanged.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 2, columns: 2 })
if (!table || !table.setCellRichText(0, 0, univerAPI.newRichText().bold('Risk'))) {
  throw new Error('Cannot prepare source cell')
}
const importedTextData = table.getCellRichText(0, 0)?.getData()
if (!importedTextData) throw new Error('Source cell is empty')
if (!table.setCellTextData(1, 0, importedTextData)) throw new Error('Cannot restore raw cell data')
```

**Types:** [`IDocumentData`](https://docs.univer.ai/reference/types/document-data.md)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.setRichTextValues`

Replaces a rectangular range with rich text in one table update command.

The matrix must be rectangular and fit inside the current table. Every builder is cloned before dispatch, and an
unchanged matrix succeeds without creating undo or collaboration traffic.

```typescript
setRichTextValues(values: RichTextValue[][], startRow?: number, startColumn?: number): boolean
```

**Parameters**

* `values` — Required. Rich-text matrix built with `univerAPI.newRichText()`.
* `startRow` — Optional. Default: `0`. Zero-based start row. Defaults to `0`.
* `startColumn` — Optional. Default: `0`. Zero-based start column. Defaults to `0`.

**Returns**

`true` when the batch succeeds or all requested cells are already current.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 2, columns: 2 })
const title = univerAPI.newRichText().bold('Status')
const value = univerAPI.newRichText().text('Approved')
if (!table || !table.setRichTextValues([[title, value]])) throw new Error('Cannot set rich text')
```

**Types:** [`RichTextValue`](https://unpkg.com/@univerjs/core@1.0.0-rc.0/lib/types/docs/data-model/rich-text-builder.d.ts)

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.setValues`

Replaces a rectangular range of cells with plain text in one table update command.

Unchanged cells do not generate a mutation. The values matrix must fit inside the current table bounds; use row or
column insertion methods first when an agent needs to grow the table.

```typescript
setValues(values: string[][], startRow?: number, startColumn?: number): boolean
```

**Parameters**

* `values` — Required. Plain-text matrix to write.
* `startRow` — Optional. Default: `0`. Zero-based start row. Defaults to `0`.
* `startColumn` — Optional. Default: `0`. Zero-based start column. Defaults to `0`.

**Returns**

`true` when the update succeeds or the requested values are already present.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (
  !table ||
  !table.setValues([
    ['Task', 'Owner'],
    ['Review', 'Alex'],
  ])
)
  throw new Error('Cannot set values')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)

### `FBoardTable.unmergeCell`

Unmerges the merged range containing one cell.

```typescript
unmergeCell(row: number, column: number): boolean
```

**Parameters**

* `row` — Required. Zero-based row inside the merged range.
* `column` — Required. Zero-based column inside the merged range.

**Returns**

`true` when the command succeeds or the cell is already unmerged.

**Examples**

```ts
const board = univerAPI.getActiveBoard()
if (!board) throw new Error('No active board')
const table = board.insertTable({ left: 80, top: 80, rows: 3, columns: 3 })
if (
  !table ||
  !table.mergeCells({ startRow: 0, endRow: 0, startColumn: 0, endColumn: 1 }) ||
  !table.unmergeCell(0, 0)
)
  throw new Error('Cannot unmerge cells')
```

**Package:** [`@univerjs-pro/boards-table`](https://docs.univer.ai/reference/packages/plugins/univerjs-pro/boards-table.md) · [Type definitions](https://unpkg.com/@univerjs-pro/boards-table@1.0.0-rc.0/lib/types/facade/f-board-table.d.ts)
