> For the complete documentation index, see [llms.txt](https://docs.nighty.one/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nighty.one/ui-scripting/api-reference/ui-elements/table.md).

# Table

## <mark style="color:green;">class</mark> **UI.Table**

{% hint style="info" %}
This documentation is a work in progress. UI scripting is a new feature, and additional content is still being added. Stay tuned for updates!
{% endhint %}

<table><thead><tr><th width="334">Attribute</th><th>Value</th></tr></thead><tbody><tr><td>columns</td><td><p>a <code>list</code> of columns (<code>dict</code>)<br><br><code>column</code> properties:<br>type: <code>"tag"</code>, <code>"text"</code> or <code>"button"</code><br>label: any <code>string</code><br>buttons: a <code>list</code> of buttons (<code>dict</code>)</p><p></p><p><code>buttons</code> properties:<br>label: any <code>string</code><br>color: <code>default</code> | <code>danger</code><br>onClick: <code>func</code><br><br>This value is required.</p></td></tr><tr><td>rows</td><td><p>a <code>list</code> of rows (<code>dict</code>)</p><p></p><p>row structure (<code>dict</code>):</p><p><code>id</code>: <strong>Must be unique</strong>. Duplicate IDs can cause unexpected behavior and may result in incorrect UI rendering. Ensure each ID is distinct to avoid issues.</p><p><code>cells</code>: a <code>list</code> of cells that match the structure of <code>columns</code><br></p><p>cell structure (<code>dict</code>):</p><p>tag: <code>text</code>, <code>color</code></p><p>text: <code>text</code>, <code>subtext</code>, <code>imageUrl</code></p><p>button: <code>{}</code></p><p><br>Default: <code>[]</code></p></td></tr><tr><td>search</td><td><code>True | False</code><br><br>Default: <code>True</code></td></tr><tr><td>items_per_page</td><td>any <code>int</code><br><br>Default: <code>50</code></td></tr><tr><td>selectable</td><td><code>True | False</code><br><br>Default: <code>False</code></td></tr><tr><td>visible</td><td>See <a href="/pages/DTBGfFducdgJJ6exaVF7#visible">Visible</a>.<br><br>Default: <code>True</code></td></tr></tbody></table>

### Events

<table><thead><tr><th>Event</th><th width="286">Arguments</th><th>Description</th></tr></thead><tbody><tr><td>onSelectionChange</td><td>selected_rows (<code>list</code> of row ids)</td><td>Triggered when the selection changes.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nighty.one/ui-scripting/api-reference/ui-elements/table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
