TableConversionAdditionalSlot
interface
By default, only the tableRow
elements from the table
model are downcast inside the <table>
and
all other elements are pushed outside the table. This handler allows creating additional slots inside
the table for other elements.
Take this model as an example:
<table>
<tableRow>...</tableRow>
<tableRow>...</tableRow>
<tableColumnGroup>...</tableColumnGroup>
</table>
By default, downcasting result will be:
<table>
<tbody>
<tr>...</tr>
<tr>...</tr>
</tbody>
</table>
<colgroup>...</colgroup>
To allow the tableColumnGroup
element at the end of the table, use the following configuration:
const additionalSlot = {
filter: element => element.is( 'element', 'tableColumnGroup' ),
positionOffset: 'end'
}
Now, the downcast result will be:
<table>
<tbody>
<tr>...</tr>
<tr>...</tr>
</tbody>
<colgroup>...</colgroup>
</table>
Properties
-
module:table/tableediting~TableConversionAdditionalSlot#filter
Filter for elements that should be placed inside given slot.
-
module:table/tableediting~TableConversionAdditionalSlot#positionOffset
Position of the slot within the table.