# table/converters/downcast

module

<a id="interfaces">

## Interfaces

<a id="interface-DowncastTableOptions">

### `DowncastTableOptions`

<a id="functions">

## Functions

<a id="function-convertParagraphInTableCell">

### `convertParagraphInTableCell( options = { options.asWidget? } ) → DowncastElementCreatorFunction` _(internal)_

Overrides paragraph inside table cell conversion.

This converter:

* should be used to override default paragraph conversion.
* It will only convert `<paragraph>` placed directly inside `<tableCell>`.
* For a single paragraph without attributes it returns `<span>` to simulate data table.
* For all other cases it returns `<p>` element.

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

#### Parameters

* `options: object`

  Properties

  * `options.asWidget?: boolean`

    If set to `true`, the downcast conversion will produce a widget.

  Defaults to `{}`

#### Returns

* `DowncastElementCreatorFunction`

  Element creator.

<a id="function-convertPlainTable">

### `convertPlainTable( editor ) → DowncastElementCreatorFunction`

Downcasts a plain table (also used in the clipboard pipeline).

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

#### Parameters

* `editor: Editor`

#### Returns

* `DowncastElementCreatorFunction`

<a id="function-convertPlainTableCaption">

### `convertPlainTableCaption( editor ) → DowncastElementCreatorFunction`

Downcasts a plain table caption (also used in the clipboard pipeline).

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

#### Parameters

* `editor: Editor`

#### Returns

* `DowncastElementCreatorFunction`

<a id="function-downcastCell">

### `downcastCell( options = { options.asWidget?, options.cellTypeEnabled } ) → DowncastElementCreatorFunction` _(internal)_

Model table cell element to view `<td>` or `<th>` element conversion helper.

This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column) and `<td>` otherwise.

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

#### Parameters

* `options: object`

  Properties

  * `options.asWidget?: boolean`

    If set to `true`, the downcast conversion will produce a widget.

  * `options.cellTypeEnabled: () => boolean`

    If returns `true`, the downcast conversion will use the `tableCellType` attribute to determine cell type.

#### Returns

* `DowncastElementCreatorFunction`

  Element creator.

<a id="function-downcastPlainTable">

### `downcastPlainTable( table, conversionApi, editor ) → ViewElement`

Downcasts a plain table.

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

#### Parameters

* `table: ModelElement`

  Table model element.

* `conversionApi: DowncastConversionApi`

  The conversion API object.

* `editor: Editor`

  The editor instance.

#### Returns

* `ViewElement`

  Created element.

<a id="function-downcastRow">

### `downcastRow() → DowncastElementCreatorFunction` _(internal)_

Model table row element to view `<tr>` element conversion helper.

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

#### Returns

* `DowncastElementCreatorFunction`

  Element creator.

<a id="function-downcastTable">

### `downcastTable( tableUtils, options ) → DowncastElementCreatorFunction` _(internal)_

Model table element to view table element conversion helper.

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

#### Parameters

* `tableUtils: TableUtils`
* `options: DowncastTableOptions`

#### Returns

* `DowncastElementCreatorFunction`

<a id="function-downcastTableBorderAndBackgroundAttributes">

### `downcastTableBorderAndBackgroundAttributes( editor ) → void`

Registers border and background attributes converters for plain tables or when the clipboard pipeline is used.

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

#### Parameters

* `editor: Editor`

#### Returns

* `void`

<a id="function-isSingleParagraphWithoutAttributes">

### `isSingleParagraphWithoutAttributes( modelElement ) → boolean` _(internal)_

Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.

The paragraph should be converted in the editing view to:

* If returned `true` - to a `<span class="ck-table-bogus-paragraph">`
* If returned `false` - to a `<p>`

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

#### Parameters

* `modelElement: ModelElement`

#### Returns

* `boolean`

---

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