Class: CellStyle

Core.SpreadsheetEditor. CellStyle

Encapsulates the styling and formatting options for a cell in a sheet to allow customization of aspects such as font, background color, alignment, and cell borders.

new CellStyle()

Properties:
Name Type Description
backgroundColor string The background color of a cell within a sheet.
horizontalAlignment Core.SpreadsheetEditor.Types.HorizontalAlignment The horizontal alignment of the cell's content within a sheet.
verticalAlignment Core.SpreadsheetEditor.Types.VerticalAlignment The vertical alignment of the cell's content within a sheet.
wrapText Core.SpreadsheetEditor.Types.TextWrap Enum for text wrapping behavior for cells within a sheet.
font Core.SpreadsheetEditor.Font The font used for the cell's content, encapsulating properties like font face, size, color, and style.

Methods


equals(cellStyle)

compares the CellStyle with another CellStyle to determine if they are equal.
Parameters:
Name Type Description
cellStyle object Destination object to compare with.
Returns:
true if this object is equal to obj; otherwise, false.
Type
boolean

getCellBorder()

Retrieves the border style of a specific side of a cell within a sheet. Useful to access the styling details of cell borders, such as thickness and color.
Returns:
The border type of the cell.
Type
Core.SpreadsheetEditor.Types.BorderOptions

getDataFormatString()

Retrieves the data formatting string applied to a cell's content within a sheet. Enables access to the format specification, which dictates how the cell's data is visually represented.
Returns:
A string representing the data format applied to the cell. This format string determines how the cell's content is displayed, such as number formats, date formats, or custom text formats.
Type
string

setCellBorder(border)

Sets the cell border style to a specified border with a customized type.
Parameters:
Name Type Description
border Core.SpreadsheetEditor.Types.BorderOptions
Properties
Name Type Argument Description
type Core.SpreadsheetEditor.Types.BorderType The type of the border as defined in the BorderType enum. @see Core.SpreadsheetEditor.Types.BorderType
style Core.SpreadsheetEditor.Types.BorderStyle <optional>
The drawing style of the border. Defaults to BorderStyle.MEDIUM. @see Core.SpreadsheetEditor.Types.BorderStyle
color string <optional>
The color of the border in HEX or CSS rgb() strings. Defaults to '#000000'.

setDataFormatString(format)

Applies a specific data format string to the cell's content that allows for the customization of how numeric values, dates, and other data types are displayed within a cell.
Parameters:
Name Type Description
format string A string specifying the format to apply to the cell's content. The format string determines how data types like numbers and dates are formatted.