> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# console: table() method

APISummary
`table` displays tabular data as a table.

## Syntax

```ts
table(data: any, columns: array?): undefined;
```

### Parameters

#### data

The data to display. This must be either an array or an object. Each item in the array, or property in the object, is represented by a row in the table. The first column in the table is labeled (index) and its values are the array indices or the property names.

#### columns

An array which can be used to restrict the columns shown in the table. It contains indices, if each entry of data is an array, or property names, if each entry of data is an object. The resulting table then includes only columns for items which match the given indices or names.

### return value

None(`undefined`).

## Compatibility

**Compatibility Table**

**Query:** `lynx-api.global.console.table`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/global/console/table.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| table | Yes (3.2) | Yes (3.4) | Yes (3.2) | Yes (3.5) | Yes (3.5) | Yes |

**`table`**

print message by table

