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

# init(of:selection:sortOrder:columnCustomization:columns:rows:)

Creates a sortable table with the given columns and rows that supports
selecting multiple rows and dynamically customizable columns.

```
nonisolated init<Sort>(of valueType: Value.Type = Value.self, selection: Binding<Set<Value.ID>>, sortOrder: Binding<[Sort]>, columnCustomization: Binding<TableColumnCustomization<Value>>, @TableColumnBuilder<Value, Sort> columns: () -> Columns, @TableRowBuilder<Value> rows: () -> Rows) where Sort : SortComparator, Columns.TableRowValue == Sort.Compared
```

## Parameters

`valueType`

The type of value used to derive the table’s contents.

`selection`

A binding to a set that identifies selected rows ids.

`sortOrder`

A binding to the ordered sorting of columns.

`columnCustomization`

A binding to the state of columns.

`columns`

The columns to display in the table.

`rows`

The rows to display in the table.

## Discussion

Each column in the table that should participate in customization is
required to have an identifier, specified with
[`customizationID(_:)`](/documentation/SwiftUI/TableColumnContent/customizationID(_:)).

---

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)