# GC.Spread.Sheets.Tables.TableStyle

## Content

# Class: TableStyle

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

## Table of contents

### Constructors

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

### Properties

- [backColor](GC.Spread.Sheets.Tables.TableStyle#backcolor)
- [borderBottom](GC.Spread.Sheets.Tables.TableStyle#borderbottom)
- [borderHorizontal](GC.Spread.Sheets.Tables.TableStyle#borderhorizontal)
- [borderLeft](GC.Spread.Sheets.Tables.TableStyle#borderleft)
- [borderRight](GC.Spread.Sheets.Tables.TableStyle#borderright)
- [borderTop](GC.Spread.Sheets.Tables.TableStyle#bordertop)
- [borderVertical](GC.Spread.Sheets.Tables.TableStyle#bordervertical)
- [font](GC.Spread.Sheets.Tables.TableStyle#font)
- [fontFamily](GC.Spread.Sheets.Tables.TableStyle#fontfamily)
- [fontSize](GC.Spread.Sheets.Tables.TableStyle#fontsize)
- [fontStyle](GC.Spread.Sheets.Tables.TableStyle#fontstyle)
- [fontWeight](GC.Spread.Sheets.Tables.TableStyle#fontweight)
- [foreColor](GC.Spread.Sheets.Tables.TableStyle#forecolor)
- [textDecoration](GC.Spread.Sheets.Tables.TableStyle#textdecoration)

## Constructors

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

• **new TableStyle**(`backColor?`, `foreColor?`, `font?`, `borderLeft?`, `borderTop?`, `borderRight?`, `borderBottom?`, `borderHorizontal?`, `borderVertical?`, `textDecoration?`, `fontStyle?`, `fontWeight?`, `fontSize?`, `fontFamily?`)

Represents table style information.

**`example`**
```javascript
//This example creates a table.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tableStyleInfo = new GC.Spread.Sheets.Tables.TableStyle(
    "black",
    "white",
    "bold 11pt arial",
    new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin),
    new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thick),
    new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.thin),
    new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thick),
    new GC.Spread.Sheets.LineBorder("pink", GC.Spread.Sheets.LineStyle.thin),
    new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.thick),
    GC.Spread.Sheets.TextDecorationType.overline | GC.Spread.Sheets.TextDecorationType.underline);
tableStyle.headerRowStyle(tableStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

#### Parameters

| Name | Type |
| :------ | :------ |
| `backColor?` | `string` \| [`IGradientFill`](../interfaces/GC.Spread.Sheets.IGradientFill) \| [`IGradientPathFill`](../interfaces/GC.Spread.Sheets.IGradientPathFill) \| [`IPatternFill`](../interfaces/GC.Spread.Sheets.IPatternFill) |
| `foreColor?` | `string` |
| `font?` | `string` |
| `borderLeft?` | [`LineBorder`](GC.Spread.Sheets.LineBorder) |
| `borderTop?` | [`LineBorder`](GC.Spread.Sheets.LineBorder) |
| `borderRight?` | [`LineBorder`](GC.Spread.Sheets.LineBorder) |
| `borderBottom?` | [`LineBorder`](GC.Spread.Sheets.LineBorder) |
| `borderHorizontal?` | [`LineBorder`](GC.Spread.Sheets.LineBorder) |
| `borderVertical?` | [`LineBorder`](GC.Spread.Sheets.LineBorder) |
| `textDecoration?` | [`TextDecorationType`](../enums/GC.Spread.Sheets.TextDecorationType) |
| `fontStyle?` | `string` |
| `fontWeight?` | `string` |
| `fontSize?` | `string` |
| `fontFamily?` | `string` |

## Properties

### <a id="backcolor" name="backcolor"></a> backColor

• **backColor**: `string` \| [`IGradientFill`](../interfaces/GC.Spread.Sheets.IGradientFill) \| [`IGradientPathFill`](../interfaces/GC.Spread.Sheets.IGradientPathFill) \| [`IPatternFill`](../interfaces/GC.Spread.Sheets.IPatternFill)

Indicates the background color.

**`example`**
```javascript
//This example creates a table.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="borderbottom" name="borderbottom"></a> borderBottom

• **borderBottom**: [`LineBorder`](GC.Spread.Sheets.LineBorder)

Indicates the bottom border line of the table.

**`example`**
```javascript
//This example creates a table.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="borderhorizontal" name="borderhorizontal"></a> borderHorizontal

• **borderHorizontal**: [`LineBorder`](GC.Spread.Sheets.LineBorder)

Indicates the horizontal border line of the table.

**`example`**
```javascript
//This example sets the borderHorizontal property.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.firstRowStripStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="borderleft" name="borderleft"></a> borderLeft

• **borderLeft**: [`LineBorder`](GC.Spread.Sheets.LineBorder)

Indicates the left border line of the table.

**`example`**
```javascript
//This example creates a table.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="borderright" name="borderright"></a> borderRight

• **borderRight**: [`LineBorder`](GC.Spread.Sheets.LineBorder)

Indicates the right border line of the table.

**`example`**
```javascript
//This example creates a table.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="bordertop" name="bordertop"></a> borderTop

• **borderTop**: [`LineBorder`](GC.Spread.Sheets.LineBorder)

Indicates the top border line of the table.

**`example`**
```javascript
//This example creates a table.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="bordervertical" name="bordervertical"></a> borderVertical

• **borderVertical**: [`LineBorder`](GC.Spread.Sheets.LineBorder)

Indicates the vertical border line of the table.

**`example`**
```javascript
//This example sets the borderHorizontal property.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.firstRowStripStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

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

• **font**: `string`

Indicates the font.

**`example`**
```javascript
//This example creates a table.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderBottom = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderLeft = new GC.Spread.Sheets.LineBorder("yellow", GC.Spread.Sheets.LineStyle.medium);
tStyleInfo.borderTop = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderRight = new GC.Spread.Sheets.LineBorder("green", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.headerRowStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="fontfamily" name="fontfamily"></a> fontFamily

• **fontFamily**: `string`

Indicates the font family.

**`example`**
```javascript
//This example sets the fontFamily property.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'));
var activeSheet = spread.getActiveSheet();
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle();
wholeTableStyle.fontFamily = "Arial Black";
tableStyle.wholeTableStyle(wholeTableStyle);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="fontsize" name="fontsize"></a> fontSize

• **fontSize**: `string`

Indicates the font size.

**`example`**
```javascript
//This example sets the fontSize property.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'));
var activeSheet = spread.getActiveSheet();
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle();
wholeTableStyle.fontSize = "16px";
tableStyle.wholeTableStyle(wholeTableStyle);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="fontstyle" name="fontstyle"></a> fontStyle

• **fontStyle**: `string`

Indicates the font style.

**`example`**
```javascript
//This example sets the fontStyle property.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'));
var activeSheet = spread.getActiveSheet();
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle();
wholeTableStyle.fontStyle = "italic";
tableStyle.wholeTableStyle(wholeTableStyle);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="fontweight" name="fontweight"></a> fontWeight

• **fontWeight**: `string`

Indicates the font weight.

**`example`**
```javascript
//This example sets the fontWeight property.
var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'));
var activeSheet = spread.getActiveSheet();
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var wholeTableStyle = new GC.Spread.Sheets.Tables.TableStyle();
wholeTableStyle.fontWeight = "bold";
tableStyle.wholeTableStyle(wholeTableStyle);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="forecolor" name="forecolor"></a> foreColor

• **foreColor**: `string`

Indicates the foreground color.

**`example`**
```javascript
//This example sets the borderHorizontal property.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.borderHorizontal = new GC.Spread.Sheets.LineBorder("red", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.borderVertical = new GC.Spread.Sheets.LineBorder("blue", GC.Spread.Sheets.LineStyle.thin);
tStyleInfo.font = "bold 11pt arial";
tableStyle.firstRowStripStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```

___

### <a id="textdecoration" name="textdecoration"></a> textDecoration

• **textDecoration**: [`TextDecorationType`](../enums/GC.Spread.Sheets.TextDecorationType)

Indicates the text decoration of the table.

**`example`**
```javascript
//This example sets the textDecoration property.
var tableStyle = new GC.Spread.Sheets.Tables.TableTheme();
var thinBorder = new GC.Spread.Sheets.LineBorder("black", GC.Spread.Sheets.LineStyle.dotted);
tableStyle.wholeTableStyle(new GC.Spread.Sheets.Tables.TableStyle("aliceblue", "green", "bold 10pt arial", thinBorder, thinBorder, thinBorder, thinBorder, thinBorder, thinBorder));
var tStyleInfo = new GC.Spread.Sheets.Tables.TableStyle();
tStyleInfo.backColor = "green";
tStyleInfo.foreColor = "red";
tStyleInfo.font = "bold 11pt arial";
tStyleInfo.textDecoration = GC.Spread.Sheets.TextDecorationType.doubleUnderline;
tableStyle.firstRowStripStyle(tStyleInfo);
var table = activeSheet.tables.add("table1", 1, 1, 5, 5, tableStyle);
```
