<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITableViewDelegate/tableView(_:heightForHeaderInSection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(pl)UITableViewDelegate(im)tableView:heightForHeaderInSection:"
  },
  "title" : "tableView(_:heightForHeaderInSection:)"
}
-->

# tableView(_:heightForHeaderInSection:)

Asks the delegate for the height to use for the header of a particular section.

```
optional func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
```

## Parameters

`tableView`

The table view requesting this information.

`section`

An index number identifying a section of `tableView` .

## Return Value

A nonnegative floating-point value that specifies the height (in points) of the header for `section`.

## Discussion

Use this method to specify the height of custom header views returned by your [`tableView(_:viewForHeaderInSection:)`](/documentation/UIKit/UITableViewDelegate/tableView(_:viewForHeaderInSection:)) method.

## See Also

[`-  tableView:estimatedHeightForHeaderInSection:`](/documentation/UIKit/UITableViewDelegate/tableView(_:estimatedHeightForHeaderInSection:))

Asks the delegate for the estimated height of the header of a particular section.

[`-  tableView:viewForHeaderInSection:`](/documentation/UIKit/UITableViewDelegate/tableView(_:viewForHeaderInSection:))

Asks the delegate for a view to display in the header of the specified section of the table view.



---

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)