# GC.Spread.Sheets.Tables.CustomTableThemeManager

## Content

# Class: CustomTableThemeManager

[Sheets](../modules/GC.Spread.Sheets).[Tables](../modules/GC.Spread.Sheets.Tables).CustomTableThemeManager

## Hierarchy

- [`CustomThemeManagerBase`](GC.Spread.Sheets.CustomThemeManagerBase)

  ↳ **`CustomTableThemeManager`**

## Table of contents

### Constructors

- [constructor](GC.Spread.Sheets.Tables.CustomTableThemeManager#constructor)

### Methods

- [add](GC.Spread.Sheets.Tables.CustomTableThemeManager#add)
- [all](GC.Spread.Sheets.Tables.CustomTableThemeManager#all)
- [get](GC.Spread.Sheets.Tables.CustomTableThemeManager#get)
- [remove](GC.Spread.Sheets.Tables.CustomTableThemeManager#remove)
- [update](GC.Spread.Sheets.Tables.CustomTableThemeManager#update)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new CustomTableThemeManager**(`workbook`)

Represents a custom table theme manager that can manage all custom table themes.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `workbook` | [`Workbook`](GC.Spread.Sheets.Workbook) | The workbook. |

#### Overrides

[CustomThemeManagerBase](GC.Spread.Sheets.CustomThemeManagerBase).[constructor](GC.Spread.Sheets.CustomThemeManagerBase#constructor)

## Methods

### <a id="add" name="add"></a> add

▸ **add**(`theme`): `undefined` \| [`TableTheme`](GC.Spread.Sheets.Tables.TableTheme)

add a new table theme.

**`example`**
```
// add a new table theme named "custom0"
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let tableStyle = spread.customTableThemes.add("custom0");
let firstColumnStripStyle = new GC.Spread.Sheets.Tables.TableStyle();
firstColumnStripStyle.backColor = "#0C66E4";
tableStyle.firstColumnStripStyle(firstColumnStripStyle);
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `theme` | `string` \| [`TableTheme`](GC.Spread.Sheets.Tables.TableTheme) | the new table theme or just a new table theme name you want to add |

#### Returns

`undefined` \| [`TableTheme`](GC.Spread.Sheets.Tables.TableTheme)

return the newly added table theme, if the named table theme is existed, failed to add table theme and return undefined

___

### <a id="all" name="all"></a> all

▸ **all**(): [`TableTheme`](GC.Spread.Sheets.Tables.TableTheme)[]

get the table themes collection.

**`example`**
```
// get all table table themes
let tableStylesCollection = spread.customTableThemes.all();
```

#### Returns

[`TableTheme`](GC.Spread.Sheets.Tables.TableTheme)[]

Array<GC.Spread.Sheets.Tables.TableTheme>

___

### <a id="get" name="get"></a> get

▸ **get**(`name`): `undefined` \| [`TableTheme`](GC.Spread.Sheets.Tables.TableTheme)

get the table theme by name.

**`example`**
```
// get table theme
tableStyle = spread.customTableThemes.get("custom0");
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | the specific name of the table theme to get |

#### Returns

`undefined` \| [`TableTheme`](GC.Spread.Sheets.Tables.TableTheme)

If the corresponding table theme with the spefic name is found, return the theme; otherwise, return undefined.

___

### <a id="remove" name="remove"></a> remove

▸ **remove**(`name`): `void`

remove the table theme by name.

**`example`**
```
// delete table theme
spread.customTableThemes.remove("custom0");
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `name` | `string` | the specific name of the table theme to remove |

#### Returns

`void`

___

### <a id="update" name="update"></a> update

▸ **update**(`oldThemeName`, `newTheme`): `void`

update the table theme.

**`example`**
```
// update table theme
tableStyle = spread.customTableThemes.update("custom0", new GC.Spread.Sheets.Tables.TableTheme());
```

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `oldThemeName` | `string` | the specific name of the table theme to update |
| `newTheme` | [`TableTheme`](GC.Spread.Sheets.Tables.TableTheme) | the specific name of the table theme to update |

#### Returns

`void`
