# TableConfig

interface

The configuration of the table feature. Used by the table feature in the `@ckeditor/ckeditor5-table` package.

```typescript
ClassicEditor
	.create( {
		table: ... // Table feature options.
	} )
	.then( ... )
	.catch( ... );
```

See [all editor options](module_core_editor_editorconfig-EditorConfig.md).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L27)

<a id="properties">

## Properties

<a id="member-contentToolbar">

### `contentToolbar?: Array<ToolbarConfigItem>`

Items to be placed in the table content toolbar. The [`TableToolbar`](module_table_tabletoolbar-TableToolbar.md) plugin is required to make this toolbar work.

Assuming that you use the [`TableUI`](module_table_tableui-TableUI.md) feature, the following toolbar items will be available in [`ComponentFactory`](module_ui_componentfactory-ComponentFactory.md):

* `'tableRow'`,
* `'tableColumn'`,
* `'mergeTableCells'`.

You can thus configure the toolbar like this:

```typescript
const tableConfig = {
	contentToolbar: [ 'tableRow', 'tableColumn', 'mergeTableCells' ]
};
```

Of course, the same buttons can also be used in the [main editor toolbar](module_core_editor_editorconfig-EditorConfig.md#member-toolbar).

Read more about configuring the toolbar in [`toolbar`](module_core_editor_editorconfig-EditorConfig.md#member-toolbar).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L101)

<a id="member-defaultFooters">

### `defaultFooters?: number`

Number of footer rows to render by default when inserting new tables.

You can configure it like this:

```typescript
const tableConfig = {
	defaultFooters: 1
};
```

The rows property is optional, defaulting to 0 (no footer). This option is ignored when [`config.table.enableFooters`](#member-enableFooters) is `false`.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L64)

<a id="member-defaultHeadings">

### `defaultHeadings?: object`

Number of rows and columns to render by the table heading when inserting new tables.

You can configure it like this:

```typescript
const tableConfig = {
	defaultHeadings: {
		rows: 1,
		columns: 1
	}
};
```

Both rows and columns properties are optional, defaulting to 0 (no heading).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L45)

<a id="member-enableFooters">

### `enableFooters?: boolean`

Enables support for table footers (`<tfoot>`).

When set to `true`, the editor will upcast and downcast `<tfoot>` elements, and the footer toggle will be visible in the table row dropdown. When set to `false` (default), footer rows are ignored and the footer toggle is hidden in the table row dropdown.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L75)

Defaults to `false`

<a id="member-showHiddenBorders">

### `showHiddenBorders?: boolean`

When set to `true` (default), the editor visually displays dashed borders around table elements (`<table>`, `<td>`, `<th>`) that contain inline styles explicitly removing borders (for example: `border: none`, `border-top-style: none`, etc.).

This visualization is shown **only in the editing view**. It does not modify the underlying table data or the HTML produced by the editor. When set to `false`, the editor will not render any dashed borders, and elements with `border: none` will remain visually borderless during editing.

```typescript
const tableConfig = {
	showHiddenBorders: false
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L289)

Defaults to `true`

<a id="member-tableCaption">

### `tableCaption?: TableCaptionConfig`

Configuration of the table caption feature.

```typescript
const tableConfig = {
	tableCaption: ... // Table caption feature config.
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L259)

<a id="member-tableCellProperties">

### `tableCellProperties?: TableCellPropertiesConfig`

The configuration of the table cell properties user interface (balloon). It allows us to define:

* The color palette for the cell border color style field (`tableCellProperties.borderColors`),
* The color palette for the cell background style field (`tableCellProperties.backgroundColors`).

```typescript
const tableConfig = {
	tableCellProperties: {
		borderColors: [
			{
				color: 'hsl(0, 0%, 90%)',
				label: 'Light grey'
			},
			// ...
		],
		backgroundColors: [
			{
				color: 'hsl(120, 75%, 60%)',
				label: 'Green'
			},
			// ...
		]
	}
};
```

* The default styles for table cells (`tableCellProperties.defaultProperties`):

```typescript
const tableConfig = {
	tableCellProperties: {
		defaultProperties: {
			horizontalAlignment: 'right',
			verticalAlignment: 'bottom',
			padding: '5px'
		}
	}
}
```

[Read more about the supported properties.](module_table_tableconfig-TablePropertiesOptions.md)

**Note**: The `borderColors` and `backgroundColors` options do not impact the data loaded into the editor, i.e., they do not limit or filter the colors in the data. They are used only in the user interface, allowing users to pick colors in a more convenient way. The `defaultProperties` option does impact the data. The editor model will not keep the default values.

The default color palettes for the cell background and the cell border are identical ([check out their content](module_table_utils_ui_table-properties.md#constant-defaultColors)).

Both color palette configurations must follow the [table color configuration format](module_table_tableconfig-TableColorConfig.md).

Read more about configuring the table feature in [`TableConfig`](module_table_tableconfig-TableConfig.md).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L237)

<a id="member-tableLayout">

### `tableLayout?: TableLayoutConfig`

Configuration of the table layout feature.

```typescript
const tableConfig = {
	tableLayout: ... // Table layout feature config.
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L248)

<a id="member-tableProperties">

### `tableProperties?: TablePropertiesConfig`

The configuration of the table properties user interface (balloon). It allows us to define:

* The color palette for the table border color style field (`tableProperties.borderColors`),
* The color palette for the table background style field (`tableProperties.backgroundColors`).

```typescript
const tableConfig = {
	tableProperties: {
		borderColors: [
			{
				color: 'hsl(0, 0%, 90%)',
				label: 'Light grey'
			},
			// ...
		],
		backgroundColors: [
			{
				color: 'hsl(120, 75%, 60%)',
				label: 'Green'
			},
			// ...
		]
	}
};
```

* The default styles for tables (`tableProperties.defaultProperties`):

```
const tableConfig = {
	tableProperties: {
		defaultProperties: {
			borderStyle: 'dashed',
			borderColor: 'hsl(0, 0%, 90%)',
			borderWidth: '3px',
			alignment: 'left'
		}
	}
}
```

[Read more about the supported properties.](module_table_tableconfig-TablePropertiesOptions.md)

**Note**: The `borderColors` and `backgroundColors` options do not impact the data loaded into the editor, i.e., they do not limit or filter the colors in the data. They are used only in the user interface, allowing users to pick colors more conveniently. The `defaultProperties` option does impact the data. The editor model will not keep the default values.

The default color palettes for the table background and the table border are the same ([check out their content](module_table_utils_ui_table-properties.md#constant-defaultColors)).

Both color palette configurations must follow the [table color configuration format](module_table_tableconfig-TableColorConfig.md).

Read more about configuring the table feature in [`TableConfig`](module_table_tableconfig-TableConfig.md).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L179)

<a id="member-tableScroll">

### `tableScroll?: TableScrollConfig`

Configuration of the table scroll feature.

```typescript
const tableConfig = {
	tableScroll: ... // Table scroll feature config.
};
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L270)

<a id="member-tableToolbar">

### `tableToolbar?: Array<ToolbarConfigItem>`

Items to be placed in the table toolbar. The [`TableToolbar`](module_table_tabletoolbar-TableToolbar.md) plugin is required to make this toolbar work.

You can thus configure the toolbar like this:

```typescript
const tableConfig = {
	tableToolbar: [ 'blockQuote' ]
};
```

Of course, the same buttons can also be used in the [main editor toolbar](module_core_editor_editorconfig-EditorConfig.md#member-toolbar).

Read more about configuring the toolbar in [`toolbar`](module_core_editor_editorconfig-EditorConfig.md#member-toolbar).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/tableconfig.ts#L120)

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
