---
title: sizeToFit()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nstablecolumn/sizetofit()
---

# sizeToFit()

Resizes the table column to fit the width of its header cell.

## Declaration

```swift
func sizeToFit()
```

## Discussion

Discussion If the table column’s maximum width is less than the width of the header, the maximum is increased to the header’s width. Similarly, if the table column’s minimum width is greater than the width of the header, the minimum is reduced to the header’s width. If this method causes the table column’s width to change, the column’s table view is marked as needing display.

## See Also

### Controlling Size

- [width](appkit/nstablecolumn/width.md)
- [minWidth](appkit/nstablecolumn/minwidth.md)
- [maxWidth](appkit/nstablecolumn/maxwidth.md)
- [resizingMask](appkit/nstablecolumn/resizingmask.md)
