# table/utils/resize

module

<a id="constants"></a>

## Constants

<a id="constant-RESIZE_DISTANCE_THRESHOLD"></a>

### `RESIZE_DISTANCE_THRESHOLD: 3`

The distance in pixels that the mouse has to move to start resizing a column or a row.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/resize.ts#L28)

<a id="constant-RESIZE_PRECISION"></a>

### `RESIZE_PRECISION: 2`

Determines how many digits after the decimal point are used to store the column widths and the row heights.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/resize.ts#L21)

<a id="functions"></a>

## Functions

<a id="function-fitResizerToTable"></a>

### `fitResizerToTable( view, viewResizer, type ) → void` _(internal)_

Sets the side styles of a column or a row resizer handle, so it stretches over the whole height or width of the table.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/resize.ts#L121)

#### Parameters

* `view: EditingView`

  The editing view.

* `viewResizer: ViewElement`

  The resizer handle element.

* `type: 'row' | 'column'`

  Whether it is a column or a row resizer.

#### Returns

* `void`

<a id="function-registerResizerInserter"></a>

### `registerResizerInserter( editor, className ) → void` _(internal)_

Registers a listener ensuring that each table cell has a column or a row resizer handle.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/resize.ts#L90)

#### Parameters

* `editor: Editor`

  The editor instance.

* `className: string`

  The class of the resizer handle element.

#### Returns

* `void`

<a id="function-resetResizerStyles"></a>

### `resetResizerStyles( view, viewResizer, type ) → void` _(internal)_

Removes the side styles set by [`fitResizerToTable()`](#function-fitResizerToTable).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/resize.ts#L150)

#### Parameters

* `view: EditingView`

  The editing view.

* `viewResizer: ViewElement`

  The resizer handle element.

* `type: 'row' | 'column'`

  Whether it is a column or a row resizer.

#### Returns

* `void`

<a id="function-toPrecision"></a>

### `toPrecision( value ) → number` _(internal)_

Rounds the provided value to a fixed-point number with defined number of digits after the decimal point.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/resize.ts#L37)

#### Parameters

* `value: string | number`

  A number to be rounded.

#### Returns

* `number`

  The rounded number.

<a id="function-toggleResizingCursor"></a>

### `toggleResizingCursor( className, cursor, isActive ) → void` _(internal)_

Shows the resizing cursor everywhere while a column or a row is resized, also when the editor is in a shadow root.

The class goes to the `<body>` and is styled by a rule adopted into the document, as a theme stylesheet loaded into a shadow root cannot style the `<body>`. The cursor of the shadow host is inherited by the editor content inside.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/resize.ts#L55)

#### Parameters

* `className: string`

  The class that sets the cursor.

* `cursor: string`

  The cursor to show.

* `isActive: boolean`

  Whether the resizing is in progress.

#### Returns

* `void`

<a id="function-toggleResizingDisabledClass"></a>

### `toggleResizingDisabledClass( view, className, isResizingAllowed ) → void` _(internal)_

Toggles the class that hides the column or the row resizer handles (through CSS) on all editing roots.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-table/src/utils/resize.ts#L71)

#### Parameters

* `view: EditingView`

  The editing view.

* `className: string`

  The class that hides the resizer handles.

* `isResizingAllowed: boolean`

  Whether the resizing is allowed. The class is added when it is not.

#### Returns

* `void`

---

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