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>
Copy code
By default, downcasting result will be:
<table>
<tbody>
<tr>...</tr>
<tr>...</tr>
</tbody>
</table>
<colgroup>...</colgroup>
Copy code
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'
}
Copy code
Now, the downcast result will be:
<table>
<tbody>
<tr>...</tr>
<tr>...</tr>
</tbody>
<colgroup>...</colgroup>
</table>
Copy code
Properties
module:table/tableediting~TableConversionAdditionalSlot#filterFilter for elements that should be placed inside given slot.
module:table/tableediting~TableConversionAdditionalSlot#positionOffsetPosition of the slot within the table.