<!--
{
  "availability" : [
    "iOS: 17.4.0 -",
    "iPadOS: 17.4.0 -",
    "macCatalyst: 17.4.0 -",
    "macOS: 14.4.0 -",
    "visionOS: 1.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/TableColumnForEach/init(_:id:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI18TableColumnForEachV_2id7contentACyxq_q0_q1_q2_Gx_s7KeyPathCy7ElementQzq_Gq2_AJctcfc"
  },
  "title" : "init(_:id:content:)"
}
-->

# init(_:id:content:)

Creates an instance that uniquely identifies and creates table columns
across updates based on the provided key path to the underlying data’s
identifier.

```
nonisolated init(_ data: Data, id: KeyPath<Data.Element, ID>, @TableColumnBuilder<TableColumnForEach<Data, ID, RowValue, Sort, Content>.TableRowValue, TableColumnForEach<Data, ID, RowValue, Sort, Content>.TableColumnSortComparator> content: @escaping (Data.Element) -> Content)
```

## Parameters

`data`

The data that the [`TableColumnForEach`](/documentation/SwiftUI/TableColumnForEach) instance uses to
create table columns dynamically.

`id`

The key path to the provided data’s identifier.

`content`

The table column builder that creates columns dynamically
for each element.

---

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)