# renderTable

`function` in `utils` · v0.7.0

<https://docs.seedcord.org/packages/utils/0.7.0/functions/render-table>

Renders a grid of strings as a framed monospace table for Discord output.

Column widths use display width, so emoji, astral, and CJK cells stay aligned. The first row is a header by default with a separator beneath it. Ragged rows are padded to the widest row.

Pass `budget` to get one string per page instead of a single string, splitting the body across a character limit and re-emitting the header on each page.

## Signature 1

```ts
renderTable(
    data: readonly (readonly string[])[],
    options: PagedTableOptions
): string[]
```

Renders a grid of strings as a framed monospace table for Discord output.

Column widths use display width, so emoji, astral, and CJK cells stay aligned. The first row is a header by default with a separator beneath it. Ragged rows are padded to the widest row.

Pass `budget` to get one string per page instead of a single string, splitting the body across a character limit and re-emitting the header on each page.

Parameters.

- `data` `readonly (readonly string[])[]` — Rows of cells. The widest row sets the column count.
- `options` `PagedTableOptions` — Rendering options, see [`TableOptions`](/packages/utils/0.7.0/interfaces/table-options) and [`PagedTableOptions`](/packages/utils/0.7.0/interfaces/paged-table-options).

Returns `string[]`.

## Signature 2

```ts
renderTable(
    data: readonly (readonly string[])[],
    options?: TableOptions
): string
```

Parameters.

- `data` `readonly (readonly string[])[]`
- `options?` `TableOptions`

Returns `string`.
