Cell

23 Sep 20252 minutes to read

Represents the cell.

Properties

chart ChartModel[]

Specifies the chart of the cell.

Defaults to []

colSpan number

Specifies the column-wise cell merge count.

Defaults to 1

format string

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

Defaults to ‘General’

formula string

Defines the formula or expression of the cell.

Defaults to ’’

Specifies the hyperlink of the cell.

Defaults to ’’

image ImageModel[]

Specifies the image of the cell.

Defaults to []

index number

Specifies the index of the cell.

Defaults to 0

isLocked boolean

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

Defaults to true

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.

Defaults to false

notes string

Specifies the note of the cell.

Defaults to ’’

rowSpan number

Specifies the row-wise cell merge count.

Defaults to 1

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');

Defaults to {}

validation ValidationModel

Specifies the validation of the cell.

Defaults to ’’

value string

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

Defaults to ’’

wrap boolean

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

Defaults to false