---
title: "rect(for:layoutAt:in:textContainer:characterRange:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstexttable/rect(for:layoutat:in:textcontainer:characterrange:)"
---

# rect(for:layoutAt:in:textContainer:characterRange:)

Returns the rectangle within which glyphs should be laid out for a text table block.

## Declaration

```swift
func rect(for block: NSTextTableBlock, layoutAt startingPoint: NSPoint, in rect: NSRect, textContainer: NSTextContainer, characterRange charRange: NSRange) -> NSRect
```

## Parameters

- `block`: The text table block that wants to determine where to layout its glyphs.
- `startingPoint`: The location, in container coordinates, where layout begins.
- `rect`: The rectangle in which the block is constrained to lie. For top-level blocks, this is the container rectangle of textContainer; for nested blocks, this is the layout rectangle of the enclosing block.
- `textContainer`: The text container being used for the layout.
- `charRange`: The range of the characters whose glyphs are to be drawn.

## Return Value

Return Value The rectangle within which glyphs should be laid out.

## Discussion

Discussion This method is called by the text table block block to determine the rectangle within which glyphs should be laid out for the text table block.

## See Also

### Determining layout rectangles

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