API Reference

FSlideTableCell

Facade object for a single slide table cell.

Access

Access through:

Example

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.setText('Ready')cell?.setBackgroundColor('#E8F1FF')

Setup

Register @univerjs-pro/slides-table or a preset that includes it. In plugin mode, import @univerjs-pro/slides-table/facade. Additional methods below require their listed plugin packages. See Facade setup.

@univerjs-pro/slides-table

FSlideTableCell.clearBackground

Clear this cell's fill.

TypeScript
clearBackground(): boolean

Returns

Whether the command succeeded.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.clearBackground()

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.getColumnIndex

Return the zero-based column index.

TypeScript
getColumnIndex(): number

Returns

The column index.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 1)console.log(cell?.getColumnIndex())

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.getData

Return the raw cell snapshot.

TypeScript
getData(): ISlideTableCell | null

Returns

The cell snapshot, or null when the cell does not exist.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)console.log(cell?.getData())

Types: ISlideTableCell

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.getRichText

Returns this cell as a detached rich-text value.

TypeScript
getRichText(): RichTextValue | null

Returns

A detached value suitable for .copy() and setRichText(), or null for an empty cell.

Types: RichTextValue

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.getRowIndex

Return the zero-based row index.

TypeScript
getRowIndex(): number

Returns

The row index.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(1, 0)console.log(cell?.getRowIndex())

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.getStyle

Return the cell style.

TypeScript
getStyle(): ISlideTableCellStyle | undefined

Returns

The cell style.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)console.log(cell?.getStyle())

Types: ISlideTableCellStyle

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.getTable

Return the parent table facade.

TypeScript
getTable(): FSlideTable

Returns

The parent table.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)console.log(cell?.getTable())

Types: FSlideTable

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.getText

Return the plain text in this cell.

TypeScript
getText(): string

Returns

The plain cell text.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)console.log(cell?.getText())

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.getTextData

Return the raw Univer document data in this cell.

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

TypeScript
getTextData(): IDocumentData | undefined

Returns

The cell rich text data.

Examples

TypeScript
// Advanced: export the exact document model for lossless storage or migration.const presentation = univerAPI.getActivePresentation()if (!presentation) throw new Error('No active presentation')const slide = presentation.getSlideByIndex(0)const table = slide.getTableById('status-table')const cell = table?.getCell(0, 0)const textData = cell?.getTextData()if (textData) console.log(JSON.stringify(textData))

Types: IDocumentData

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.mergeTo

Merge this cell with a rectangular span starting at this cell.

TypeScript
mergeTo(rowSpan: number, columnSpan: number): boolean

Parameters

  • rowSpan — Required. The number of rows to include.
  • columnSpan — Required. The number of columns to include.

Returns

Whether the command succeeded.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.mergeTo(2, 2)

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.setBackgroundColor

Set a solid background color for this cell.

TypeScript
setBackgroundColor(color: string): boolean

Parameters

  • color — Required. The background color.

Returns

Whether the command succeeded.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.setBackgroundColor('#E8F1FF')

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.setBorder

Apply borders to this cell.

TypeScript
setBorder(border: ISlideTableBorder): boolean

Parameters

  • border — Required. The border style.

Returns

Whether the command succeeded.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.setBorder({  color: '#111827',  width: 1,  dash: univerAPI.Enum.SlideTableBorderDashEnum.Solid,})

Types: ISlideTableBorder

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.setFill

Set the cell fill.

TypeScript
setFill(fill?: ISlideTableFill): boolean

Parameters

  • fill — Optional. The fill, or undefined to clear it.

Returns

Whether the command succeeded.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.setFill({  type: univerAPI.Enum.SlideTableFillTypeEnum.Solid,  color: '#E8F1FF',  alpha: 1,})

Types: ISlideTableFill

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.setRichText

Replaces this cell with a detached value returned by univerAPI.newRichText().

TypeScript
setRichText(richText: RichTextValue): boolean

Parameters

  • richText — Required. Rich-text value to store in the cell.

Returns

Whether the command succeeded.

Examples

TypeScript
const text = univerAPI  .newRichText()  .align({ horizontal: univerAPI.Enum.HorizontalAlign.CENTER })  .text('Ready')cell.setRichText(text)

Types: RichTextValue

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.setStyle

Merge supported style fields into this cell.

TypeScript
setStyle(style: ISlideTableCellStyle): boolean

Parameters

  • style — Required. The style patch.

Returns

Whether the command succeeded.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.setStyle({  fill: {    type: univerAPI.Enum.SlideTableFillTypeEnum.Solid,    color: '#E8F1FF',    alpha: 1,  },  borders: {    left: {      color: '#111827',      width: 1,      dash: univerAPI.Enum.SlideTableBorderDashEnum.Dash,    },  },  margins: {    left: 8,    right: 8,  },  verticalAlign: univerAPI.Enum.SlideTableVerticalAlignEnum.Middle,  textDirection: univerAPI.Enum.SlideTableTextDirectionEnum.Horizontal,})

Types: ISlideTableCellStyle

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.setText

Replace this cell with plain text.

TypeScript
setText(text: string): boolean

Parameters

  • text — Required. The new plain text.

Returns

Whether the command succeeded.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.setText('Ready')

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.setTextData

Replace this cell with raw Univer document data.

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

TypeScript
setTextData(textData: IDocumentData): boolean

Parameters

  • textData — Required. The rich text document data.

Returns

Whether the command succeeded.

Examples

TypeScript
// Advanced: copy exact imported document data without rebuilding its runs and ranges.const presentation = univerAPI.getActivePresentation()if (!presentation) throw new Error('No active presentation')const slide = presentation.getSlideByIndex(0)const table = slide.getTableById('status-table')const importedTextData = table?.getCell(0, 0)?.getTextData()if (!importedTextData) throw new Error('Imported cell data is unavailable')const targetCell = table?.getCell(0, 1)if (!targetCell?.setTextData(importedTextData)) throw new Error('Cannot restore raw cell data')

Types: IDocumentData

Package: @univerjs-pro/slides-table · Type definitions

FSlideTableCell.unmerge

Unmerge the merged range containing this cell.

TypeScript
unmerge(): boolean

Returns

Whether the command succeeded.

Examples

TypeScript
const fPresentation = univerAPI.getActivePresentation()const fSlide = fPresentation.getSlideByIndex(0)const table = fSlide.getTableById('status-table')const cell = table.getCell(0, 0)cell?.unmerge()

Package: @univerjs-pro/slides-table · Type definitions

How is this guide?

© 2026 DreamNum Co., Ltd.