<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableViewDelegate/tableView(_:willDisplayCell:for:row:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTableViewDelegate(im)tableView:willDisplayCell:forTableColumn:row:"
  },
  "title" : "tableView(_:willDisplayCell:for:row:)"
}
-->

# tableView(_:willDisplayCell:for:row:)

Tells the delegate that the table view will display the specified cell at the specified row and column.

```
@MainActor optional func tableView(_ tableView: NSTableView, willDisplayCell cell: Any, for tableColumn: NSTableColumn?, row: Int)
```

## Parameters

`tableView`

The table view that sent the message.

`cell`

The cell to be displayed.

`tableColumn`

The table column.

`row`

The row index.

## Discussion

The delegate can modify the display attributes of `aCell` to alter the appearance of the cell.

Because `aCell` is reused for every row in `aTableColumn`, the delegate must set the display attributes both when drawing special cells and when drawing standard cells.

> Note:
> The implementation of this method must not draw portions of the cell. It should only alter the state of the passed-in cell.

---

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)