---
title: "init(_:id:content:)"
framework: swiftui
role: symbol
role_heading: Initializer
path: "swiftui/tablecolumnforeach/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.

## Declaration

```swift
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 doc://com.apple.SwiftUI/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.

## See Also

### Creating the collection

- [init(_:content:)](swiftui/tablecolumnforeach/init(_:content:).md)
