Table column resize
The TableColumnResize
plugin lets you resize tables and individual table columns. It gives you complete control over column width.
# Demo
To resize a column, simply hover your pointer over the column edge until it gets highlighted. Drag the column edge until you achieve the desired size.
This demo presents a limited set of features. Visit the feature-rich editor example to see more in action.
The column resize feature is compatible with the Export to Word feature. The converter will respect the column width set in the editor and retain it in the created .DOCX file.
# Installation
By default, the table column resize feature is not included in the predefined builds and must be installed separately.
To enable the table column resize feature in your editor, you need to have the @ckeditor/ckeditor5-table
package installed (it is already present in the predefined builds):
npm install --save @ckeditor/ckeditor5-table
Then add the Table
and TableColumnResize
plugins to your plugin list and configure the table toolbar:
import { Table, TableColumnResize } from '@ckeditor/ckeditor5-table';
ClassicEditor
.create( document.querySelector( '#editor' ), {
plugins: [ Table, TableColumnResize, /* ... */ ],
toolbar: [ 'insertTable', /* ... */ ],
} )
.then( /* ... */ )
.catch( /* ... */ );
# Common API
The TableColumnResize
plugin does not register UI components.
We recommend using the official CKEditor 5 inspector for development and debugging. It will give you tons of useful information about the state of the editor such as internal data structures, selection, commands, and many more.
# Contribute
The source code of the feature is available on GitHub at https://github.com/ckeditor/ckeditor5/tree/master/packages/ckeditor5-table.
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.