TableStyleCollection

TableStyleCollection class

Represents all custom table styles.

class TableStyleCollection;

Properties

PropertyTypeDescription
defaultTableStyleNamestringGets and sets the default style name of the table.
defaultPivotStyleNamestringGets and sets the default style name of pivot table .

Methods

MethodDescription
get(number)Gets the table style by the index.
get(string)Gets the table style by the name.
addTableStyle(string)Adds a custom table style.
addPivotTableStyle(string)Adds a custom pivot table style.
getBuiltinTableStyle(TableStyleType)Gets the builtin table style

defaultTableStyleName

Gets and sets the default style name of the table.

defaultTableStyleName : string;

defaultPivotStyleName

Gets and sets the default style name of pivot table .

defaultPivotStyleName : string;

get(number)

Gets the table style by the index.

get(index: number) : TableStyle;

Parameters:

ParameterTypeDescription
indexnumberThe position of the table style in the list.

Returns

The table style object.

get(string)

Gets the table style by the name.

get(name: string) : TableStyle;

Parameters:

ParameterTypeDescription
namestringThe table style name.

Returns

The table style object.

addTableStyle(string)

Adds a custom table style.

addTableStyle(name: string) : number;

Parameters:

ParameterTypeDescription
namestringThe table style name.

Returns

The index of the table style.

addPivotTableStyle(string)

Adds a custom pivot table style.

addPivotTableStyle(name: string) : number;

Parameters:

ParameterTypeDescription
namestringThe pivot table style name.

Returns

The index of the pivot table style.

getBuiltinTableStyle(TableStyleType)

Gets the builtin table style

getBuiltinTableStyle(type: TableStyleType) : TableStyle;

Parameters:

ParameterTypeDescription
typeTableStyleTypeThe builtin table style type.

Returns

TableStyle