[**Documentation**](../../../README)

***

[Documentation](../../../README) / [zerotal](../../README) / [logger](../README) / renderTable

# Function: renderTable()

> **renderTable**(`data`, `indent?`): `string`[]

Defined in: [packages/core/src/logger/renderTable.ts:37](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/logger/renderTable.ts#L37)

Render `data` as the lines of a box-drawn table, without a trailing newline.

An array of objects becomes a column per key, in the order the first row
introduces them, with a header. A single object becomes two columns of
key and value. Numeric columns are right-aligned so digits line up.

## Parameters

### data

[`TableData`](../type-aliases/TableData)

Rows to render.

### indent?

`number` = `2`

Spaces before each line, to sit the table under its message.

## Returns

`string`[]

One string per line; empty when there is nothing to show.

## Example

```ts
renderTable([{ page: "home", ms: 12 }, { page: "about", ms: 4 }]).join("\n");
```
