Show: Inherited Protected Private Deprecated

# CKEDITOR.Table Class

Defined in: `src/core/table.js:16`

Table class utility. Provides methods for create, delete and update tables.

## Constructor

### `CKEDITOR.Table`

(

- `editor`

)

Defined in `src/core/table.js:16`

#### Parameters:

- `editor` Object

  The CKEditor instance.

## Index

### Methods

- _createElement
- create
- getFromSelection
- getHeading
- isEditable
- remove
- setAttributes
- setHeading

## Methods

### `_createElement`

(

- `name`

)
CKEDITOR.dom.element protected

Defined in `src/core/table.js:320`

Creates a new CKEDITOR.dom.element using the passed tag name.

#### Parameters:

- `name` String

  The tag name from which an element should be created

#### Returns:

CKEDITOR.dom.element:

Instance of CKEDITOR DOM element class

### `create`

(

- `config`

)
Object

Defined in `src/core/table.js:36`

Creates a table.

#### Parameters:

- `config` Object

  Table configuration object

#### Returns:

Object:

The created table

### `getFromSelection`

() CKEDITOR.dom.element

Defined in `src/core/table.js:77`

Retrieves a table from the current selection.

#### Returns:

CKEDITOR.dom.element:

The retrieved table or null if not found.

### `getHeading`

(

- `table`

)
String

Defined in `src/core/table.js:134`

Returns which heading style is set for the given table.

#### Parameters:

- `table` CKEDITOR.dom.element

  The table to gather the heading from. If null, it will be retrieved from the current selection.

#### Returns:

String:

The heading of the table. Expected values are `CKEDITOR.Table.NONE`, `CKEDITOR.Table.ROW`, `CKEDITOR.Table.COL` and `CKEDITOR.Table.BOTH`.

### `isEditable`

(

- `el`

)
Boolean

Defined in `src/core/table.js:109`

Checks if a given table can be considered as editable. This method workarounds a limitation of IE where for some elements (like table), `isContentEditable` returns always false. This is because IE does not support `contenteditable` on such elements. However, despite such elements cannot be set as content editable directly, a content editable SPAN, or DIV element can be placed inside the individual table cells. See https://msdn.microsoft.com/en-us/library/ms537837%28v=VS.85%29.aspx

#### Parameters:

- `el` CKEDITOR.dom.element

  The table element to test if editable

#### Returns:

Boolean:

### `remove`

(

- `table`

)

Defined in `src/core/table.js:176`

Removes a table from the editor.

#### Parameters:

- `table` CKEDITOR.dom.element

  The table element which table style should be removed.

### `setAttributes`

(

- `table`
- `attrs`

)

Defined in `src/core/table.js:207`

Assigns provided attributes to a table.

#### Parameters:

- `table` Object

  The table to which the attributes should be assigned

- `attrs` Object

  The attributes which have to be assigned to the table

### `setHeading`

(

- `table`
- `heading`

)

Defined in `src/core/table.js:222`

Sets the appropriate table heading style to a table.

#### Parameters:

- `table` CKEDITOR.dom.element

  The table element to which the heading should be set. If null, it will be retrieved from the current selection.

- `heading` String

  The table heading to be set. Accepted values are: `CKEDITOR.Table.NONE`, `CKEDITOR.Table.ROW`, `CKEDITOR.Table.COL` and `CKEDITOR.Table.BOTH`.