---
title: NSTextTable
framework: appkit
role: symbol
role_heading: Class
path: appkit/nstexttable
---

# NSTextTable

An object that represents a text table as a whole.

## Declaration

```swift
class NSTextTable
```

## Overview

Overview A text table is responsible for laying out and drawing the text table blocks it contains, and it maintains the basic parameters of the table.

## Topics

### Getting and setting number of columns

- [numberOfColumns](appkit/nstexttable/numberofcolumns.md)

### Getting and setting layout algorithm

- [layoutAlgorithm](appkit/nstexttable/layoutalgorithm-swift.property.md)

### Collapsing borders

- [collapsesBorders](appkit/nstexttable/collapsesborders.md)

### Hiding empty cells

- [hidesEmptyCells](appkit/nstexttable/hidesemptycells.md)

### Determining layout rectangles

- [rect(for:layoutAt:in:textContainer:characterRange:)](appkit/nstexttable/rect(for:layoutat:in:textcontainer:characterrange:).md)
- [boundsRect(for:contentRect:in:textContainer:characterRange:)](appkit/nstexttable/boundsrect(for:contentrect:in:textcontainer:characterrange:).md)

### Drawing the table

- [drawBackground(for:withFrame:in:characterRange:layoutManager:)](appkit/nstexttable/drawbackground(for:withframe:in:characterrange:layoutmanager:).md)

### Constants

- [NSTextTable.LayoutAlgorithm](appkit/nstexttable/layoutalgorithm-swift.enum.md)

## Relationships

### Inherits From

- [NSTextBlock](appkit/nstextblock.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Formatting and attributes

- [NSParagraphStyle](appkit/nsparagraphstyle.md)
- [NSMutableParagraphStyle](appkit/nsmutableparagraphstyle.md)
- [NSTextTab](appkit/nstexttab.md)
- [NSTextList](appkit/nstextlist.md)
- [NSTextTableBlock](appkit/nstexttableblock.md)
- [NSTextBlock](appkit/nstextblock.md)
