# `ExRatatui.Widgets.Table`
[🔗](https://github.com/mcass19/ex_ratatui/blob/v0.7.1/lib/ex_ratatui/widgets/table.ex#L1)

A table widget with headers, rows, and optional selection.

## Fields

  * `:rows` - list of rows, each row is a list of cell strings
  * `:header` - optional list of header cell strings
  * `:widths` - list of constraint tuples for column widths
    (e.g., `[{:length, 10}, {:percentage, 50}, {:min, 5}]`)
  * `:style` - `%ExRatatui.Style{}` for the table
  * `:block` - optional `%ExRatatui.Widgets.Block{}` container
  * `:highlight_style` - `%ExRatatui.Style{}` for the selected row
  * `:highlight_symbol` - string prefix for the selected row
  * `:selected` - zero-based index of the selected row, or `nil`
  * `:column_spacing` - spacing between columns (default: 1)

## Examples

    iex> %ExRatatui.Widgets.Table{
    ...>   rows: [["Alice", "30"], ["Bob", "25"]],
    ...>   header: ["Name", "Age"],
    ...>   widths: [{:length, 15}, {:length, 10}]
    ...> }
    %ExRatatui.Widgets.Table{
      rows: [["Alice", "30"], ["Bob", "25"]],
      header: ["Name", "Age"],
      widths: [length: 15, length: 10],
      style: %ExRatatui.Style{},
      block: nil,
      highlight_style: %ExRatatui.Style{},
      highlight_symbol: nil,
      selected: nil,
      column_spacing: 1
    }

# `t`

```elixir
@type t() :: %ExRatatui.Widgets.Table{
  block: ExRatatui.Widgets.Block.t() | nil,
  column_spacing: non_neg_integer(),
  header: [String.t()] | nil,
  highlight_style: ExRatatui.Style.t(),
  highlight_symbol: String.t() | nil,
  rows: [[String.t()]],
  selected: non_neg_integer() | nil,
  style: ExRatatui.Style.t(),
  widths: [ExRatatui.Layout.constraint()]
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
