# Table
> A data table with a header, row hover and selection, and an optional caption.
Source: https://native.shellui.dev/docs/components/data-display/table
One template holds `Table`, `TableHeader`, `TableRow`, `TableHead` and `TableCell`. `Columns` takes Grid widths for every row; use star and fixed widths, since each row is its own grid.
## Installation
```bash
shellui-native add table
```
**Platforms:** MAUI · Avalonia.
## Usage
### Basic
**MAUI**
```xml
```
**Avalonia**
```xml
```
[Live preview](https://native.shellui.dev/preview/index.html?c=table-basic)
## MAUI and Avalonia
- Rows raise `Tapped` on both; on Avalonia it's Avalonia's own `Tapped` event, so the handler takes `TappedEventArgs`.
- Set `IsSelected` on a row to highlight it.
## API
### Table
XAML children go to `Rows`.
| Property | Type | Default | Description |
|---|---|---|---|
| `Columns` | `string` | — | Column widths for every row, as Grid lengths (`2*,*,100`). Use star and fixed widths: each row is its own grid. |
| `Caption` | `string` | — | Muted caption under the table. |
| `Bordered` | `bool` | `true` | Draws the outline. |
| `MinimumContentWidth` | `double` | `0` | Narrower than this, the table scrolls horizontally instead of squeezing its columns. |
### TableHeader
| Property | Type | Default | Description |
|---|---|---|---|
| `Columns` | `string` | — | Column widths for a header used outside a Table. |
| `IsSelected` | `bool` | `false` | Highlights the row as selected. |
| Event | Arguments | Description |
|---|---|---|
| `Tapped` | — | The row was clicked or tapped. MAUI only. |
### TableRow
| Property | Type | Default | Description |
|---|---|---|---|
| `Columns` | `string` | — | Column widths for a row used outside a Table. |
| `IsSelected` | `bool` | `false` | Highlights the row as selected. |
| Event | Arguments | Description |
|---|---|---|
| `Tapped` | — | The row was clicked or tapped. MAUI only. |
### TableHead
| Property | Type | Default | Description |
|---|---|---|---|
| `Text` | `string` | — | Text shown by the component. |
| `HorizontalTextAlignment` | `TextAlignment` | `Start` | Text alignment in the cell. |
### TableCell
| Property | Type | Default | Description |
|---|---|---|---|
| `Text` | `string` | — | Text shown by the component. |
| `HorizontalTextAlignment` | `TextAlignment` | `Start` | Text alignment in the cell. |
| `IsBold` | `bool` | `false` | Medium-weight text, for the row's key column. |