---
title: "tableView(_:heightForHeaderInSection:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uitableviewdelegate/tableview(_:heightforheaderinsection:)"
---

# tableView(_:heightForHeaderInSection:)

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

## Declaration

```swift
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 .

## Mentioned in

Adding headers and footers to table sections

## Return Value

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

## Discussion

Discussion Use this method to specify the height of custom header views returned by your tableView(_:viewForHeaderInSection:) method.

## See Also

### Related Documentation

- [tableView(_:estimatedHeightForHeaderInSection:)](uikit/uitableviewdelegate/tableview(_:estimatedheightforheaderinsection:).md)
- [tableView(_:viewForHeaderInSection:)](uikit/uitableviewdelegate/tableview(_:viewforheaderinsection:).md)

### Providing header, footer, and row heights

- [tableView(_:heightForRowAt:)](uikit/uitableviewdelegate/tableview(_:heightforrowat:).md)
- [tableView(_:heightForFooterInSection:)](uikit/uitableviewdelegate/tableview(_:heightforfooterinsection:).md)
- [automaticDimension](uikit/uitableview/automaticdimension.md)
