---
title: NSTextTableBlock
framework: uikit
role: symbol
role_heading: Class
path: uikit/nstexttableblock
---

# NSTextTableBlock

A text block that represents a single cell in a text table.

## Declaration

```swift
class NSTextTableBlock
```

## Mentioned in

Adding tables to attributed strings in UIKit

## Overview

Overview NSTextTableBlock is a subclass of NSTextBlock that places a paragraph in a cell of an NSTextTable. When you create an NSTextTableBlock, you specify the table it belongs to, the cell’s starting row and column, and how many rows and columns the cell spans. To build a table, create an NSTextTable, then create an NSTextTableBlock for each cell. Assign each block to a paragraph by setting textBlocks on an NSMutableParagraphStyle and applying that style to the paragraph’s range in your attributed string.

## Topics

### Creating a text table block

- [init(table:startingRow:rowSpan:startingColumn:columnSpan:)](uikit/nstexttableblock/init(table:startingrow:rowspan:startingcolumn:columnspan:).md)
- [init(coder:)](uikit/nstexttableblock/init(coder:).md)

### Accessing the parent table

- [table](uikit/nstexttableblock/table.md)

### Accessing cell position

- [startingRow](uikit/nstexttableblock/startingrow.md)
- [rowSpan](uikit/nstexttableblock/rowspan.md)
- [startingColumn](uikit/nstexttableblock/startingcolumn.md)
- [columnSpan](uikit/nstexttableblock/columnspan.md)

## Relationships

### Inherits From

- [NSTextBlock](uikit/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

### Tables

- [Adding tables to attributed strings in UIKit](uikit/adding-tables-to-attributed-strings.md)
- [NSTextTable](uikit/nstexttable.md)
- [NSTextBlock](uikit/nstextblock.md)
