<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableColumn",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTableColumn"
  },
  "title" : "NSTableColumn"
}
-->

# NSTableColumn

The display characteristics and identifier for a column in a table view.

```
@MainActor class NSTableColumn
```

## Overview

A table column object determines the width (including the maximum and minimum widths) of its column in the table view and specifies the column’s  resizing and editing behavior. A table column stores two cell objects: the header cell, which is used to draw the column header, and the data cell, which is used to draw the values for each row. In a cell-based table, you can control the display of the column by specifying subclasses of `NSCell` to use and by setting the font and other display characteristics for these cells. For example, you can use an [`NSTextFieldCell`](/documentation/AppKit/NSTextFieldCell) to display string values or substitute an [`NSImageCell`](/documentation/AppKit/NSImageCell) to display pictures.

## Topics

### Creating a Table Column

[`-  initWithIdentifier:`](/documentation/AppKit/NSTableColumn/init(identifier:))

Initializes a newly created table column with a string identifier.

### Setting the Table View

[`tableView`](/documentation/AppKit/NSTableColumn/tableView)

The table view that contains the table column.

### Controlling Size

[`width`](/documentation/AppKit/NSTableColumn/width)

The table column’s width, in points.

[`minWidth`](/documentation/AppKit/NSTableColumn/minWidth)

The table column’s minimum width, in points.

[`maxWidth`](/documentation/AppKit/NSTableColumn/maxWidth)

The table column’s maximum width, in points.

[`resizingMask`](/documentation/AppKit/NSTableColumn/resizingMask)

The table column’s resizing mask.

[`-  sizeToFit`](/documentation/AppKit/NSTableColumn/sizeToFit())

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

### Setting the Header

[`title`](/documentation/AppKit/NSTableColumn/title)

The title of the table column’s header.

[`headerCell`](/documentation/AppKit/NSTableColumn/headerCell)

The cell used to draw the table column’s header.

### Setting the Identifier

[`identifier`](/documentation/AppKit/NSTableColumn/identifier)

The identifier string for the table column.

### Controlling Editability in a Cell-Based Table

[`editable`](/documentation/AppKit/NSTableColumn/isEditable)

A Boolean that indicates whether a cell-based table’s column cells are user editable.

### Sorting

[`sortDescriptorPrototype`](/documentation/AppKit/NSTableColumn/sortDescriptorPrototype)

The table column’s sort descriptor prototype.

### Setting Column Visibility

[`hidden`](/documentation/AppKit/NSTableColumn/isHidden)

A Boolean that indicates whether the table column is hidden.

### Setting Tooltips

[`headerToolTip`](/documentation/AppKit/NSTableColumn/headerToolTip)

The string that’s displayed in a help tag over the table column header.

### Deprecated Methods

[`-  isResizable`](/documentation/AppKit/NSTableColumn/isResizable)

Returns whether the column is resizable.

[`-  setResizable:`](/documentation/AppKit/NSTableColumn/setResizable:)

Sets whether the user can resize the receiver in its NSTableView.

[`dataCell`](/documentation/AppKit/NSTableColumn/dataCell)

The cell prototype used by the table column to draw individual cells.

[`-  dataCellForRow:`](/documentation/AppKit/NSTableColumn/dataCell(forRow:))

Returns the cell object used to display values in the specified row of the table column.

### Constants

[Resizing Modes](/documentation/AppKit/resizing-modes)

These constants specify the resizing modes for a table column. The values are used to set the [`resizingMask`](/documentation/AppKit/NSTableColumn/resizingMask) property.

### Initializers

[`-  initWithCoder:`](/documentation/AppKit/NSTableColumn/init(coder:))

### Structures

[`ResizingOptions`](/documentation/AppKit/NSTableColumn/ResizingOptions)

## Relationships

### Conforms To

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)