# Resize a Table in the Editor

## Environment

<table>
	<tbody>
		<tr>
			<td>Product Version</td>
			<td>3.0.0</td>
		</tr>
		<tr>
			<td>Product</td>
			<td>Progress® KendoReact Editor</td>
		</tr>
	</tbody>
</table>

## Description

How to make the table elements inside the Editor resizable?

## Solution

There is an already made plugin for [table column resizing from ProseMirror.](https://github.com/ProseMirror/prosemirror-tables)

We have made an example of KendoReact Editor that uses the columnResizing plugin. The plugin has to be added to the plugins collection on the [onMount](https://www.telerik.com/kendo-react-ui/components/editor/api/editorprops#onmount) event:

```jsx
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Editor, EditorTools, ProseMirror } from '@progress/kendo-react-editor';
import { columnResizing } from 'prosemirror-tables';
const { EditorState, EditorView } = ProseMirror;

const {
    InsertTable,
    AddRowBefore, AddRowAfter, AddColumnBefore, AddColumnAfter,
    DeleteRow, DeleteColumn, DeleteTable,
    MergeCells, SplitCell,
    Undo, Redo
} = EditorTools;

const content =
   `<p>some paragraph</p>
<table>
    <tbody>
        <tr>
            <td>Cell 1</td>
            <td>Cell 2</td>
            <td>Cell 3</td>
            <td>Cell 4</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
    </tbody>
</table>`;

const App = () => {
  const handleMount = (event) => {
      const state = event.viewProps.state;
      const plugins = [
        ...state.plugins,
        columnResizing({})
      ];

      return new EditorView(
        { mount: event.dom }, {
          ...event.viewProps,
          state: EditorState.create({ doc: state.doc, plugins })
        }
      );
  };

  return (
      <Editor
          tools={[
              [ InsertTable ],
              [ AddRowBefore, AddRowAfter, AddColumnBefore, AddColumnAfter ],
              [ DeleteRow, DeleteColumn, DeleteTable ],
              [ MergeCells, SplitCell ],
              [ Undo, Redo ]
          ]}
          defaultEditMode="div"
          onMount={handleMount}
          contentStyle={{ height: 300 }}
          defaultContent={content}
      />
  );
}
```
