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

# NSTableView

A set of related records, displayed in rows that represent individual records and columns that represent the attributes of those records.

```
class NSTableView
```

## Overview

Table views are displayed in scroll views. Beginning with macOS v10.7, you can use [`NSView`](/documentation/AppKit/NSView) objects (most commonly customized [`NSTableCellView`](/documentation/AppKit/NSTableCellView) objects) instead of cells for specifying rows and columns. You can still use [`NSCell`](/documentation/AppKit/NSCell) objects for each row and column item if you prefer.

A table view does not store its own data; it retrieves data values as needed from a data source to which it has a weak reference. You should not, therefore, directly set data values programmatically in the table view; instead, modify the values in the data source and allow the changes to be reflected in the table view. To learn about the methods that an `NSTableView` object uses to provide and access the contents of its data source object, see [`NSTableViewDataSource`](/documentation/AppKit/NSTableViewDataSource).

To customize a table view’s behavior without subclassing `NSTableView`, use the methods defined by the `NSTableViewDelegate` protocol. For example, the delegate supports table column management, type-to-select functionality, row selection and editing, custom tracking, and custom views for individual columns and rows. To learn more about the table view delegate, see [`NSTableViewDelegate`](/documentation/AppKit/NSTableViewDelegate).

> Important:
> It’s possible that your data source methods for populating the table view may be called before <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/awakeFromNib()> is called if the data source is specified in Interface Builder. You should defend against this by having the data source’s ``doc://com.apple.appkit/documentation/AppKit/NSTableViewDataSource/numberOfRows(in:)`` method return `0` for the number of rows when the data source has not yet been configured. In <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/awakeFromNib()>, when the data source is initialized you should always call `reloadData` on the table view.

### Subclassing

Subclassing `NSTableView` is usually not necessary. Instead, you customize the table view using a delegate object (an object conforming to the [`NSTableViewDelegate`](/documentation/AppKit/NSTableViewDelegate) protocol) and a data source object (conforming to the [`NSTableViewDataSource`](/documentation/AppKit/NSTableViewDataSource) protocol), or by subclassing one of the following subcomponents: cells (when using [`NSCell`](/documentation/AppKit/NSCell)-based table views), the row cell view or the row view (when using [`NSView`](/documentation/AppKit/NSView)-based table views), the table column class, or table column header classes.

### Enabling the Table View

Use the [`isEnabled`](/documentation/AppKit/NSControl/isEnabled) property to enable or disable the table view, which the view inherits from [`NSControl`](/documentation/AppKit/NSControl). This property affects the visual appearance of the table view differently depending on whether you use a view- or a cell-based table view. When you change the property’s value for a cell-based table view, the system manages the visual appearance of that table view’s rows, and updates them to a state that reflects the value. Because view-based table views permit complex items in their cells, it’s the developer’s responsibility to update each cell’s appearance as appropriate.

## Topics

### Creating a Table

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

[`-  initWithFrame:`](/documentation/AppKit/NSTableView/init(frame:))

### Managing the Table’s Data

[`dataSource`](/documentation/AppKit/NSTableView/dataSource)

The object that provides the data displayed by the table view.

[`usesStaticContents`](/documentation/AppKit/NSTableView/usesStaticContents)

A Boolean value indicating whether the table uses static data.

[`-  reloadData`](/documentation/AppKit/NSTableView/reloadData())

Marks the table view as needing redisplay, so it will reload the data for visible cells and draw the new values.

[`-  reloadDataForRowIndexes:columnIndexes:`](/documentation/AppKit/NSTableView/reloadData(forRowIndexes:columnIndexes:))

Reloads the data for only the specified rows and columns.

### Creating Views to Display

[`-  makeViewWithIdentifier:owner:`](/documentation/AppKit/NSTableView/makeView(withIdentifier:owner:))

Returns a new or existing view with the specified identifier.

[`-  rowViewAtRow:makeIfNecessary:`](/documentation/AppKit/NSTableView/rowView(atRow:makeIfNecessary:))

Returns a row view at the specified index, creating one if necessary.

[`-  viewAtColumn:row:makeIfNecessary:`](/documentation/AppKit/NSTableView/view(atColumn:row:makeIfNecessary:))

Returns a view at the specified row and column indexes, creating one if necessary.

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

### Updating the Table View Arrangement

[`-  beginUpdates`](/documentation/AppKit/NSTableView/beginUpdates())

Begins a group of updates for the table view.

[`-  endUpdates`](/documentation/AppKit/NSTableView/endUpdates())

Ends the group of updates for the table view.

[`-  moveRowAtIndex:toIndex:`](/documentation/AppKit/NSTableView/moveRow(at:to:))

Moves the specified row to the new row location using animation.

[`-  insertRowsAtIndexes:withAnimation:`](/documentation/AppKit/NSTableView/insertRows(at:withAnimation:))

Inserts the rows using the specified animation.

[`-  removeRowsAtIndexes:withAnimation:`](/documentation/AppKit/NSTableView/removeRows(at:withAnimation:))

Removes the rows using the specified animation.

[`-  rowForView:`](/documentation/AppKit/NSTableView/row(for:))

Returns the index of the row for the specified view.

[`-  columnForView:`](/documentation/AppKit/NSTableView/column(for:))

Returns the column index for the specified view.

### NSView-Based Table Nib File Registration

[`-  registerNib:forIdentifier:`](/documentation/AppKit/NSTableView/register(_:forIdentifier:))

Registers a NIB for the specified identifier, so that view-based table views can use it to instantiate views.

[`registeredNibsByIdentifier`](/documentation/AppKit/NSTableView/registeredNibsByIdentifier)

The dictionary of all registered nib files for view-based table view identifiers.

### Target-action Behavior

[`doubleAction`](/documentation/AppKit/NSTableView/doubleAction)

The message sent to the table view’s target when the user double-clicks a cell or column header.

[`clickedColumn`](/documentation/AppKit/NSTableView/clickedColumn)

The index of the column the user clicked.

[`clickedRow`](/documentation/AppKit/NSTableView/clickedRow)

The index of the row the user clicked.

### Configuring Behavior

[`allowsColumnReordering`](/documentation/AppKit/NSTableView/allowsColumnReordering)

A Boolean value indicating whether the table view allows the user to rearrange columns by dragging their headers.

[`allowsColumnResizing`](/documentation/AppKit/NSTableView/allowsColumnResizing)

A Boolean value indicating whether the table view allows the user to resize columns by dragging between their headers.

[`allowsMultipleSelection`](/documentation/AppKit/NSTableView/allowsMultipleSelection)

A Boolean value indicating whether the table view allows the user to select more than one column or row at a time.

[`allowsEmptySelection`](/documentation/AppKit/NSTableView/allowsEmptySelection)

A Boolean value indicating whether the table view allows the user to select zero columns or rows.

[`allowsColumnSelection`](/documentation/AppKit/NSTableView/allowsColumnSelection)

A Boolean value indicating whether the table view allows the user to select columns by clicking their headers.

[`usesAutomaticRowHeights`](/documentation/AppKit/NSTableView/usesAutomaticRowHeights)

A Boolean value that indicates whether the table view uses autolayout to calculate the height of rows.

### Setting Display Attributes

[`intercellSpacing`](/documentation/AppKit/NSTableView/intercellSpacing)

The horizontal and vertical spacing between cells.

[`rowHeight`](/documentation/AppKit/NSTableView/rowHeight)

The height of each row in the table.

[`backgroundColor`](/documentation/AppKit/NSTableView/backgroundColor)

The color used to draw the background of the table.

[`usesAlternatingRowBackgroundColors`](/documentation/AppKit/NSTableView/usesAlternatingRowBackgroundColors)

A Boolean value indicating whether the table view uses alternating row colors for its background.

[`style`](/documentation/AppKit/NSTableView/style-swift.property)

The style that the table view uses.

[`effectiveStyle`](/documentation/AppKit/NSTableView/effectiveStyle)

The effective style that the table uses.

[`Style`](/documentation/AppKit/NSTableView/Style-swift.enum)

Contains the possible style values for a table view.

[`selectionHighlightStyle`](/documentation/AppKit/NSTableView/selectionHighlightStyle-swift.property)

The selection highlight style used by the table view to indicate row and column selection.

[`gridColor`](/documentation/AppKit/NSTableView/gridColor)

The color used to draw grid lines.

[`gridStyleMask`](/documentation/AppKit/NSTableView/gridStyleMask)

The grid lines drawn by the table view.

[`-  indicatorImageInTableColumn:`](/documentation/AppKit/NSTableView/indicatorImage(in:))

Returns the indicator image of the specified table column.

[`-  setIndicatorImage:inTableColumn:`](/documentation/AppKit/NSTableView/setIndicatorImage(_:in:))

Sets the indicator image of the specified column.

### Getting and Setting Row Size Styles

[`effectiveRowSizeStyle`](/documentation/AppKit/NSTableView/effectiveRowSizeStyle)

The effective row size style for the table.

[`rowSizeStyle`](/documentation/AppKit/NSTableView/rowSizeStyle-swift.property)

The row size style (small, medium, large, or custom) used by the table view.

### Column Management

[`-  addTableColumn:`](/documentation/AppKit/NSTableView/addTableColumn(_:))

Adds the specified column as the last column of the table view.

[`-  removeTableColumn:`](/documentation/AppKit/NSTableView/removeTableColumn(_:))

Removes the specified column from the table view.

[`-  moveColumn:toColumn:`](/documentation/AppKit/NSTableView/moveColumn(_:toColumn:))

Moves the column and heading at the specified index to the new specified index.

[`tableColumns`](/documentation/AppKit/NSTableView/tableColumns)

An array containing the current table column objects.

[`-  columnWithIdentifier:`](/documentation/AppKit/NSTableView/column(withIdentifier:))

Returns the index of the first column in the table view whose identifier is equal to the specified identifier.

[`-  tableColumnWithIdentifier:`](/documentation/AppKit/NSTableView/tableColumn(withIdentifier:))

Returns the `NSTableColumn` object for the first column whose identifier is equal to the specified object.

### Selecting Columns and Rows

[`-  selectColumnIndexes:byExtendingSelection:`](/documentation/AppKit/NSTableView/selectColumnIndexes(_:byExtendingSelection:))

Sets the column selection using `indexes` possibly extending the selection.

[`selectedColumn`](/documentation/AppKit/NSTableView/selectedColumn)

The index of the last selected column (or the last column added to the selection).

[`selectedColumnIndexes`](/documentation/AppKit/NSTableView/selectedColumnIndexes)

An index set containing the indexes of the selected columns.

[`-  deselectColumn:`](/documentation/AppKit/NSTableView/deselectColumn(_:))

Deselects the column at the specified index if it’s selected.

[`numberOfSelectedColumns`](/documentation/AppKit/NSTableView/numberOfSelectedColumns)

The number of selected columns.

[`-  isColumnSelected:`](/documentation/AppKit/NSTableView/isColumnSelected(_:))

Returns a Boolean value that indicates whether the column at the specified index is selected.

[`-  selectRowIndexes:byExtendingSelection:`](/documentation/AppKit/NSTableView/selectRowIndexes(_:byExtendingSelection:))

Sets the row selection using `indexes` extending the selection if specified.

[`selectedRow`](/documentation/AppKit/NSTableView/selectedRow)

The index of the last selected row (or the last row added to the selection).

[`selectedRowIndexes`](/documentation/AppKit/NSTableView/selectedRowIndexes)

An index set containing the indexes of the selected rows.

[`-  deselectRow:`](/documentation/AppKit/NSTableView/deselectRow(_:))

Deselects the row at the specified index if it’s selected.

[`numberOfSelectedRows`](/documentation/AppKit/NSTableView/numberOfSelectedRows)

The number of selected rows.

[`-  isRowSelected:`](/documentation/AppKit/NSTableView/isRowSelected(_:))

Returns a Boolean value that indicates whether the row at the specified index is selected.

[`-  selectAll:`](/documentation/AppKit/NSTableView/selectAll(_:))

Selects all rows or all columns, according to whether rows or columns were most recently selected.

[`-  deselectAll:`](/documentation/AppKit/NSTableView/deselectAll(_:))

Deselects all selected rows or columns if empty selection is allowed; otherwise does nothing.

### Enumerating Table Rows

[`-  enumerateAvailableRowViewsUsingBlock:`](/documentation/AppKit/NSTableView/enumerateAvailableRowViews(_:))

Allows the enumeration of all the table rows that are known to the table view.

### Managing Type Select

[`allowsTypeSelect`](/documentation/AppKit/NSTableView/allowsTypeSelect)

A Boolean value indicating whether the table view allows the user to type characters to select rows.

### Table Dimensions

[`numberOfColumns`](/documentation/AppKit/NSTableView/numberOfColumns)

The number of columns in the table.

[`numberOfRows`](/documentation/AppKit/NSTableView/numberOfRows)

The number of rows in the table.

### Getting and Setting Floating Rows

[`floatsGroupRows`](/documentation/AppKit/NSTableView/floatsGroupRows)

A Boolean value indicating whether the table view draws grouped rows as if they are floating.

### Editing Cells

[`-  editColumn:row:withEvent:select:`](/documentation/AppKit/NSTableView/editColumn(_:row:with:select:))

Edits the cell at the specified column and row using the specified event and selection behavior.

[`editedColumn`](/documentation/AppKit/NSTableView/editedColumn)

The index of the column being edited.

[`editedRow`](/documentation/AppKit/NSTableView/editedRow)

The index of the row being edited.

### Adding and Deleting Row Views

[`-  didAddRowView:forRow:`](/documentation/AppKit/NSTableView/didAdd(_:forRow:))

Invoked when a row view is added to the table.

[`-  didRemoveRowView:forRow:`](/documentation/AppKit/NSTableView/didRemove(_:forRow:))

Invoked when a row view is removed from the table.

### Setting Auxiliary Views

[`headerView`](/documentation/AppKit/NSTableView/headerView)

The view object used to draw headers over columns.

[`cornerView`](/documentation/AppKit/NSTableView/cornerView)

The view used to draw the area to the right of the column headers and above the vertical scroller of the enclosing scroll view.

### Layout Support

[`userInterfaceLayoutDirection`](/documentation/AppKit/NSTableView/userInterfaceLayoutDirection)

The layout direction of the user interface.

[`-  rectOfColumn:`](/documentation/AppKit/NSTableView/rect(ofColumn:))

Returns the rectangle containing the column at the specified index.

[`-  rectOfRow:`](/documentation/AppKit/NSTableView/rect(ofRow:))

Returns the rectangle containing the row at the specified index.

[`-  rowsInRect:`](/documentation/AppKit/NSTableView/rows(in:))

Returns a range of indexes for the rows that lie wholly or partially within the vertical boundaries of the specified rectangle.

[`-  columnIndexesInRect:`](/documentation/AppKit/NSTableView/columnIndexes(in:))

Returns the indexes of the table view’s columns that intersect the specified rectangle.

[`-  columnAtPoint:`](/documentation/AppKit/NSTableView/column(at:))

Returns the index of the column the specified point lies in.

[`-  rowAtPoint:`](/documentation/AppKit/NSTableView/row(at:))

Returns the index of the row the specified point lies in.

[`-  frameOfCellAtColumn:row:`](/documentation/AppKit/NSTableView/frameOfCell(atColumn:row:))

Returns a rectangle locating the cell that lies at the intersection of the specified column and row.

[`columnAutoresizingStyle`](/documentation/AppKit/NSTableView/columnAutoresizingStyle-swift.property)

The table view’s column autoresizing style.

[`-  sizeLastColumnToFit`](/documentation/AppKit/NSTableView/sizeLastColumnToFit())

Resizes the last column so the table view fits exactly within its enclosing clip view.

[`-  noteNumberOfRowsChanged`](/documentation/AppKit/NSTableView/noteNumberOfRowsChanged())

Informs the table view that the number of records in its data source has changed.

[`-  tile`](/documentation/AppKit/NSTableView/tile())

Properly sizes the table view and its header view and marks it as needing display.

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

Sizes the  table view based on a uniform column autoresizing style.

[`-  noteHeightOfRowsWithIndexesChanged:`](/documentation/AppKit/NSTableView/noteHeightOfRows(withIndexesChanged:))

Informs the table view that the rows specified in `indexSet` have changed height.

### Drawing

[`-  drawRow:clipRect:`](/documentation/AppKit/NSTableView/drawRow(_:clipRect:))

Draws the cells for the row at `rowIndex` in the columns that intersect `clipRect`.

[`-  drawGridInClipRect:`](/documentation/AppKit/NSTableView/drawGrid(inClipRect:))

Draws the grid lines within the supplied rectangle.

[`-  highlightSelectionInClipRect:`](/documentation/AppKit/NSTableView/highlightSelection(inClipRect:))

Highlights the region of the table view in the specified rectangle.

[`-  drawBackgroundInClipRect:`](/documentation/AppKit/NSTableView/drawBackground(inClipRect:))

Draws the background of the table view in the clip rect specified by the rectangle.

### Scrolling

[`-  scrollRowToVisible:`](/documentation/AppKit/NSTableView/scrollRowToVisible(_:))

Scrolls the view so the specified row is visible.

[`-  scrollColumnToVisible:`](/documentation/AppKit/NSTableView/scrollColumnToVisible(_:))

Scrolls the view so the specified column is visible.

### Table Column State Persistence

[`autosaveTableColumns`](/documentation/AppKit/NSTableView/autosaveTableColumns)

A Boolean value indicating whether the order and width of the table view’s columns are automatically saved.

[`autosaveName`](/documentation/AppKit/NSTableView/autosaveName-swift.property)

The name under which table information is automatically saved.

[`AutosaveName`](/documentation/AppKit/NSTableView/AutosaveName-swift.typealias)

### Accessing the Delegate

[`delegate`](/documentation/AppKit/NSTableView/delegate)

The table view’s delegate.

### Highlightable Column Headers

[`highlightedTableColumn`](/documentation/AppKit/NSTableView/highlightedTableColumn)

The column highlighted in the table.

### Dragging

[`-  dragImageForRowsWithIndexes:tableColumns:event:offset:`](/documentation/AppKit/NSTableView/dragImageForRows(with:tableColumns:event:offset:))

Computes and returns an image to use for dragging.

[`-  canDragRowsWithIndexes:atPoint:`](/documentation/AppKit/NSTableView/canDragRows(with:at:))

Returns a Boolean value indicating whether the table view allows dragging the rows with the drag initiated at the specified point.

[`-  setDraggingSourceOperationMask:forLocal:`](/documentation/AppKit/NSTableView/setDraggingSourceOperationMask(_:forLocal:))

Sets the default operation mask returned by `draggingSourceOperationMaskForLocal:` to `mask`.

[`verticalMotionCanBeginDrag`](/documentation/AppKit/NSTableView/verticalMotionCanBeginDrag)

A Boolean value indicating whether vertical motion is treated as a drag or selection change.

[`draggingDestinationFeedbackStyle`](/documentation/AppKit/NSTableView/draggingDestinationFeedbackStyle-swift.property)

The feedback style displayed when the user drags over the table view.

[`-  setDropRow:dropOperation:`](/documentation/AppKit/NSTableView/setDropRow(_:dropOperation:))

Retargets the proposed drop operation.

### Sorting

[`sortDescriptors`](/documentation/AppKit/NSTableView/sortDescriptors)

The table view’s sort descriptors.

### Row Actions

[`rowActionsVisible`](/documentation/AppKit/NSTableView/rowActionsVisible)

A Boolean value indicating whether a table row’s actions are visible.

### Hiding and Showing Table Rows

[`-  hideRowsAtIndexes:withAnimation:`](/documentation/AppKit/NSTableView/hideRows(at:withAnimation:))

Hides the specified table rows.

[`-  unhideRowsAtIndexes:withAnimation:`](/documentation/AppKit/NSTableView/unhideRows(at:withAnimation:))

Unhides the specified table rows.

[`hiddenRowIndexes`](/documentation/AppKit/NSTableView/hiddenRowIndexes)

The indexes of all hidden table rows.

### Deprecated Methods

[`-  dragImageForRows:event:dragImageOffset:`](/documentation/AppKit/NSTableView/dragImageForRows:event:dragImageOffset:)

Computes and returns an image to use for dragging.

[`-  setAutoresizesAllColumnsToFit:`](/documentation/AppKit/NSTableView/setAutoresizesAllColumnsToFit:)

Controls whether the table view proportionally resizes its columns to fit when its superview’s frame changes.

[`-  autoresizesAllColumnsToFit`](/documentation/AppKit/NSTableView/autoresizesAllColumnsToFit)

Returns a Boolean value that indicates if the table view proportionally resizes its columns to fit when its superview’s frame changes.

[`-  selectColumn:byExtendingSelection:`](/documentation/AppKit/NSTableView/selectColumn:byExtendingSelection:)

Selects the column at the specified index, optionally extending any existing selection.

[`-  selectRow:byExtendingSelection:`](/documentation/AppKit/NSTableView/selectRow:byExtendingSelection:)

Selects a row at the specified index, optionally extending any existing selection.

  <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/tableView:writeRows:toPasteboard:>

[`-  setDrawsGrid:`](/documentation/AppKit/NSTableView/setDrawsGrid:)

Sets whether the table view draws a grid.

[`-  drawsGrid`](/documentation/AppKit/NSTableView/drawsGrid)

Returns a Boolean value that indicates whether the table view draws a grid.

[`-  selectedColumnEnumerator`](/documentation/AppKit/NSTableView/selectedColumnEnumerator)

This method has been deprecated.

[`-  selectedRowEnumerator`](/documentation/AppKit/NSTableView/selectedRowEnumerator)

This method has been deprecated.

[`-  focusedColumn`](/documentation/AppKit/NSTableView/focusedColumn())

Returns the currently focused column.

[`-  setFocusedColumn:`](/documentation/AppKit/NSTableView/setFocusedColumn(_:))

Sets the currently focused column to the specified index.

[`-  shouldFocusCell:atColumn:row:`](/documentation/AppKit/NSTableView/shouldFocusCell(_:atColumn:row:))

Returns whether the fully prepared cell at the specified row and column can be made the focused cell.

[`-  performClickOnCellAtColumn:row:`](/documentation/AppKit/NSTableView/performClickOnCell(atColumn:row:))

Performs a click action on the cell at the specified row and column.

[`-  preparedCellAtColumn:row:`](/documentation/AppKit/NSTableView/preparedCell(atColumn:row:))

Returns the fully prepared cell that the table view will use for drawing or processing of the specified row and column.

[`-  columnsInRect:`](/documentation/AppKit/NSTableView/columnsInRect:)

Returns a range of indexes for the table view’s columns that lie wholly or partially within the horizontal boundaries of the specified rectangle.

[`-  textShouldBeginEditing:`](/documentation/AppKit/NSTableView/textShouldBeginEditing:)

Queries the delegate to determine if the text should begin editing.

[`-  textDidBeginEditing:`](/documentation/AppKit/NSTableView/textDidBeginEditing:)

Posts an [`textDidBeginEditingNotification`](/documentation/AppKit/NSControl/textDidBeginEditingNotification) to the default notification center.

[`-  textDidChange:`](/documentation/AppKit/NSTableView/textDidChange:)

Sends [`textDidChange:`](/documentation/AppKit/NSTableView/textDidChange:) to the edited cell and posts an [`textDidChangeNotification`](/documentation/AppKit/NSControl/textDidChangeNotification) to the default notification center.

[`-  textShouldEndEditing:`](/documentation/AppKit/NSTableView/textShouldEndEditing:)

Validates the text object for the cell being edited by querying the delegate.queries the delegate using [`control(_:textShouldEndEditing:)`](/documentation/AppKit/NSControlTextEditingDelegate/control(_:textShouldEndEditing:)), returning the delegate’s response if it responds to that method.

[`-  textDidEndEditing:`](/documentation/AppKit/NSTableView/textDidEndEditing:)

Updates the data source based on the newly edited value and selects another cell for editing if possible according to the character that ended editing (Return, Tab, Backtab).

### Constants

[Specifying a Custom Row View in a Nib File](/documentation/AppKit/specifying-a-custom-row-view-in-a-nib-file)

View-based table view instances use `NSTableViewRowKey` to identify the nib file containing the template row view. You can specify a custom row view (without any code) by associating this key with the appropriate nib name in Interface Builder.

[`DraggingDestinationFeedbackStyle`](/documentation/AppKit/NSTableView/DraggingDestinationFeedbackStyle-swift.enum)

These constants specify the drag styles displayed by the table view. They’re used by [`draggingDestinationFeedbackStyle`](/documentation/AppKit/NSTableView/draggingDestinationFeedbackStyle-swift.property).

[`DropOperation`](/documentation/AppKit/NSTableView/DropOperation)

`NSTableView` defines these constants to specify drop operations.

[`GridLineStyle`](/documentation/AppKit/NSTableView/GridLineStyle)

`NSTableView` defines these constants to specify grid styles. These constants are used by the [`gridStyleMask`](/documentation/AppKit/NSTableView/gridStyleMask) property. The mask can be either [`NSTableViewGridNone`](/documentation/AppKit/NSTableViewGridLineStyle/NSTableViewGridNone) or it can contain either or both of the other options combined using the C bitwise `OR` operator.

[`ColumnAutoresizingStyle`](/documentation/AppKit/NSTableView/ColumnAutoresizingStyle-swift.enum)

The following constants specify the autoresizing styles. These constants are used by the  [`columnAutoresizingStyle`](/documentation/AppKit/NSTableView/columnAutoresizingStyle-swift.property) property.

[`SelectionHighlightStyle`](/documentation/AppKit/NSTableView/SelectionHighlightStyle-swift.enum)

The following constants specify the selection highlight styles. These constants are used by the [`selectionHighlightStyle`](/documentation/AppKit/NSTableView/selectionHighlightStyle-swift.property) property.

[`AnimationOptions`](/documentation/AppKit/NSTableView/AnimationOptions)

Specifies the animation effects to apply when inserting or removing rows.

[`RowSizeStyle`](/documentation/AppKit/NSTableView/RowSizeStyle-swift.enum)

The row size style constants define the size of the rows in the table view. They are used by the [`effectiveRowSizeStyle`](/documentation/AppKit/NSTableView/effectiveRowSizeStyle) and [`rowSizeStyle`](/documentation/AppKit/NSTableView/rowSizeStyle-swift.property) properties. You can also query the row size in the [`NSTableCellView`](/documentation/AppKit/NSTableCellView) class’ property [`rowSizeStyle`](/documentation/AppKit/NSTableCellView/rowSizeStyle).

[`RowActionEdge`](/documentation/AppKit/NSTableView/RowActionEdge)

These constants define table row edges on which row actions are attached. They are used by the `tableView:rowActionsForRow:edge:` delegate method.

### Notifications

[`NSTableViewColumnDidMoveNotification`](/documentation/AppKit/NSTableView/columnDidMoveNotification)

Posted whenever a column is moved by user action in an `NSTableView` object.

[`NSTableViewColumnDidResizeNotification`](/documentation/AppKit/NSTableView/columnDidResizeNotification)

Posted whenever a column is resized in an `NSTableView` object.

[`NSTableViewSelectionDidChangeNotification`](/documentation/AppKit/NSTableView/selectionDidChangeNotification)

Posted after an `NSTableView` object’s selection changes.

[`NSTableViewSelectionIsChangingNotification`](/documentation/AppKit/NSTableView/selectionIsChangingNotification)

Posted as an `NSTableView` object’s selection changes (while the mouse button is still down).

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### Inherited By

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

### Inherits From

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

---

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)