<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 12.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Table/init(_:selection:sortOrder:columns:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5TableV_9selection9sortOrder7columnsACyxAA0C14ForEachContentVyqd__Gq0_Gqd___AA7BindingVyShy2IDQzGGALySayqd_0_GGq0_yXEtcAIRs_SkRd__10Foundation14SortComparatorRd_0_7ElementQyd__0C8RowValueRt0_8ComparedQyd_0_AVRSr0_lufc::OverloadGroup"
  },
  "title" : "init(_:selection:sortOrder:columns:)"
}
-->

# init(_:selection:sortOrder:columns:)

Creates a sortable table that computes its rows based on a collection of
identifiable data, and supports selecting multiple rows.

```
nonisolated init<Data, Sort>(_ data: Data, selection: Binding<Set<Value.ID>>, sortOrder: Binding<[Sort]>, @TableColumnBuilder<Value, Sort> columns: () -> Columns) where Rows == TableForEachContent<Data>, Data : RandomAccessCollection, Sort : SortComparator, Columns.TableRowValue == Data.Element, Data.Element == Sort.Compared
```

## Parameters

`data`

The identifiable data for computing the table rows.

`selection`

A binding to a set that identifies selected rows IDs.

`sortOrder`

A binding to the ordered sorting of columns.

`columns`

The columns to display in the table.

---

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)