# clampColumnWidth (@salmonui/data-grid/engine)

> The clampColumnWidth function of @salmonui/data-grid/engine: Clamps a px width to the column's minWidth/maxWidth (and at least 1px).

Canonical: https://salmonui.dev/docs/reference/data-grid/engine/clampColumnWidth

```ts
import { clampColumnWidth } from '@salmonui/data-grid/engine';
```

Entry index: https://salmonui.dev/docs/reference/data-grid/engine (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data-grid/engine.md).

## Reference

Kind: function

```ts
function clampColumnWidth<Row>(column: CompiledColumn<Row>, width: number): number;
```

Clamps a px width to the column's `minWidth`/`maxWidth` (and at least 1px).
