CellModel

16 Dec 20252 minutes to read

Interface for a class Cell

Properties

chart ChartModel[]

Specifies the chart of the cell.

colSpan number

Specifies the column-wise cell merge count.

comment ThreadedCommentModel

Represents the threaded comment associated with the cell.
A threaded comment allows users to add a main comment and maintain a discussion through replies.
Each cell supports a single comment thread, which includes:

  • author: The name of the person who created the comment.
  • text: The main content of the comment.
  • createdTime: The timestamp indicating when the comment was added.
  • isResolved: Indicates whether the thread is marked as resolved.
  • replies: A collection of reply comments, each with its own author, text, and createdTime.

format string

Specifies the number format code to display value in specified number format.

formula string

Defines the formula or expression of the cell.

Specifies the hyperlink of the cell.

image ImageModel[]

Specifies the image of the cell.

index number

Specifies the index of the cell.

isLocked boolean

Specifies the cell is locked or not, for allow edit range in spreadsheet protect option.

isReadOnly boolean

Represents whether a cell in the sheet is read-only or not. If set to true, it prevents editing the specified cell in the sheet.

notes string|NoteModel

Specifies the note of the cell.

rowSpan number

Specifies the row-wise cell merge count.

style CellStyleModel

Specifies the cell style options.

<div id='Spreadsheet'></div>
let spreadsheet: Spreadsheet = new Spreadsheet({
     sheets: [{
      ...
           rows: [{
                 cells: [{ value: '12', index: 2,  style: { fontWeight: 'bold', fontSize: 12, fontStyle: 'italic', textIndent: '2pt'
                        backgroundColor: '#4b5366', color: '#ffffff' } }]
                 }]
           }]
 });
spreadsheet.appendTo('#Spreadsheet');

validation ValidationModel

Specifies the validation of the cell.

value string

Defines the value of the cell which can be text or number.

wrap boolean

Wraps the cell text to the next line, if the text width exceeds the column width.