Schema and default presentation for one workbook column.
Package
@sheetwrite/core
Source
packages/core/src/types/cell.ts#L86
Members 10
keyNon-empty key, unique within the sheet, used to map input and datasource values.
key: string;
headerSchema label written by table exports; the canvas header displays positional column letters.
header: string;
widthUnzoomed column width in CSS pixels.
width: number;
typeControls cell input parsing and default value formatting for this column.
type: CellFormattype CellFormat = "text" | "number" | "date" | "currency";typeCellFormat="text"|"number"|"date"|"currency";typeCellFormat=|"text"|"number"|"date"|"currency";How a column's cells are typed, parsed, and rendered: text verbatim, number via its numberFormat, date as an Excel-style serial (see date-serial.ts) rendered by a date numberFormat, and currency as a plain number rendered by a currency numberFormat (e.g. $#,##0.00).API reference →;
numberFormatExcel number-format code, e.g.
numberFormat?: string;
Excel number-format code, e.g. "#,##0.00"
numberLocaleExplicit BCP 47 locale for separators; omitted keeps the deterministic default.
numberLocale?: string;
headerStyleOverrides theme styling for the painted column-letter header.
headerStyle?:CellStyleinterface CellStyle {
bold?: boolean;
italic?: boolean;
underline?: boolean;
strikethrough?: boolean;
fontSize?: number;
color?: string;
backgroundColor?: string;
align?: CellAlign;
wrap?: boolean;
border?: CellBorders;
}interfaceCellStyle {bold?:boolean;italic?:boolean;underline?:boolean;strikethrough?:boolean;fontSize?:number;color?:string;backgroundColor?:string;align?:CellAlign;wrap?:boolean;border?:CellBorders;}interfaceCellStyle {bold?:boolean;italic?:boolean;underline?:boolean;strikethrough?:boolean;fontSize?:number;color?:string;backgroundColor?:string;align?:CellAlign;wrap?:boolean;border?:CellBorders;}Serializable formatting applied to a cell or used as a column default.API reference →;
cellStyleBase style merged beneath each cell's own style.
cellStyle?:CellStyleinterface CellStyle {
bold?: boolean;
italic?: boolean;
underline?: boolean;
strikethrough?: boolean;
fontSize?: number;
color?: string;
backgroundColor?: string;
align?: CellAlign;
wrap?: boolean;
border?: CellBorders;
}interfaceCellStyle {bold?:boolean;italic?:boolean;underline?:boolean;strikethrough?:boolean;fontSize?:number;color?:string;backgroundColor?:string;align?:CellAlign;wrap?:boolean;border?:CellBorders;}interfaceCellStyle {bold?:boolean;italic?:boolean;underline?:boolean;strikethrough?:boolean;fontSize?:number;color?:string;backgroundColor?:string;align?:CellAlign;wrap?:boolean;border?:CellBorders;}Serializable formatting applied to a cell or used as a column default.API reference →;
visibleSet to false to exclude the column from the live view and table exports.
visible?: boolean;
rendererName of a registered custom cell renderer (see Grid.defineCellRenderer).
renderer?: string;
Declaration
View full TypeScript declaration
exportinterfaceColumn {
key:string;
header:string;
width:number;
type:CellFormattype CellFormat = "text" | "number" | "date" | "currency";typeCellFormat="text"|"number"|"date"|"currency";typeCellFormat=|"text"|"number"|"date"|"currency";How a column's cells are typed, parsed, and rendered: text verbatim, number via its numberFormat, date as an Excel-style serial (see date-serial.ts) rendered by a date numberFormat, and currency as a plain number rendered by a currency numberFormat (e.g. $#,##0.00).API reference →;
numberFormat?:string;
numberLocale?:string;
headerStyle?:CellStyleinterface CellStyle {
bold?: boolean;
italic?: boolean;
underline?: boolean;
strikethrough?: boolean;
fontSize?: number;
color?: string;
backgroundColor?: string;
align?: CellAlign;
wrap?: boolean;
border?: CellBorders;
}interfaceCellStyle {bold?:boolean;italic?:boolean;underline?:boolean;strikethrough?:boolean;fontSize?:number;color?:string;backgroundColor?:string;align?:CellAlign;wrap?:boolean;border?:CellBorders;}interfaceCellStyle {bold?:boolean;italic?:boolean;underline?:boolean;strikethrough?:boolean;fontSize?:number;color?:string;backgroundColor?:string;align?:CellAlign;wrap?:boolean;border?:CellBorders;}Serializable formatting applied to a cell or used as a column default.API reference →;
cellStyle?:CellStyleinterface CellStyle {
bold?: boolean;
italic?: boolean;
underline?: boolean;
strikethrough?: boolean;
fontSize?: number;
color?: string;
backgroundColor?: string;
align?: CellAlign;
wrap?: boolean;
border?: CellBorders;
}interfaceCellStyle {bold?:boolean;italic?:boolean;underline?:boolean;strikethrough?:boolean;fontSize?:number;color?:string;backgroundColor?:string;align?:CellAlign;wrap?:boolean;border?:CellBorders;}interfaceCellStyle {bold?:boolean;italic?:boolean;underline?:boolean;strikethrough?:boolean;fontSize?:number;color?:string;backgroundColor?:string;align?:CellAlign;wrap?:boolean;border?:CellBorders;}Serializable formatting applied to a cell or used as a column default.API reference →;