<!--
{
  "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/TableStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10TableStyleP"
  },
  "title" : "TableStyle"
}
-->

# TableStyle

A type that applies a custom appearance to all tables within a view.

```
@MainActor @preconcurrency protocol TableStyle
```

## Overview

To configure the current table style for a view hierarchy, use the
[`tableStyle(_:)`](/documentation/SwiftUI/View/tableStyle(_:)) modifier.

A type conforming to this protocol inherits `@preconcurrency @MainActor`
isolation from the protocol if the conformance is included in the type’s
base declaration:

```
struct MyCustomType: Transition {
    // `@preconcurrency @MainActor` isolation by default
}
```

Isolation to the main actor is the default, but it’s not required. Declare
the conformance in an extension to opt out of main actor isolation:

```
extension MyCustomType: Transition {
    // `nonisolated` by default
}
```

## Topics

### Getting built-in table styles

[`automatic`](/documentation/SwiftUI/TableStyle/automatic)

The default table style in the current context.

[`inset`](/documentation/SwiftUI/TableStyle/inset)

The table style that describes the behavior and appearance of a table
with its content and selection inset from the table edges.

[`bordered`](/documentation/SwiftUI/TableStyle/bordered)

The table style that describes the behavior and appearance of a table
with standard border.

### Creating custom table styles

[`makeBody(configuration:)`](/documentation/SwiftUI/TableStyle/makeBody(configuration:))

Creates a view that represents the body of a table.

[`Configuration`](/documentation/SwiftUI/TableStyle/Configuration)

The properties of a table.

[`Body`](/documentation/SwiftUI/TableStyle/Body)

A view that represents the body of a table.

### Deprecated styles

[`inset(alternatesRowBackgrounds:)`](/documentation/SwiftUI/TableStyle/inset(alternatesRowBackgrounds:))

The table style that describes the behavior and appearance of a table with
its content and selection inset from the table edges.

[`bordered(alternatesRowBackgrounds:)`](/documentation/SwiftUI/TableStyle/bordered(alternatesRowBackgrounds:))

The table style that describes the behavior and appearance of a table
with standard border.

### Supporting types

[`AutomaticTableStyle`](/documentation/SwiftUI/AutomaticTableStyle)

The default table style in the current context.

[`InsetTableStyle`](/documentation/SwiftUI/InsetTableStyle)

The table style that describes the behavior and appearance of a table with
its content and selection inset from the table edges.

[`BorderedTableStyle`](/documentation/SwiftUI/BorderedTableStyle)

The table style that describes the behavior and appearance of a table with
standard border.

## Relationships

### Conforming Types

[`InsetTableStyle`](/documentation/SwiftUI/InsetTableStyle)

[`BorderedTableStyle`](/documentation/SwiftUI/BorderedTableStyle)

[`AutomaticTableStyle`](/documentation/SwiftUI/AutomaticTableStyle)

---

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)