Renders a table.
This component is a pre-styled wrapper around Flop.Phoenix.table/1. A subset of attributes are available and others have been renamed to follow our terminology.
<.table id="users" rows={@users}> <:col :let={user} label="id"><%= user.id %></:col> <:col :let={user} label="username"><%= user.username %></:col> </.table>
#
To make a row sortable, include the field attribute on the col slot:
<.table id="users" rows={@users}> <:col :let={user} field={:name}> <%= user.name %> </:col> </.table>
You must also include a handle_params callback in your LiveView.
| Column headers with links are sortable Name | Column headers with links are sortable ID | Column headers with links are sortable Company | Column headers with links are sortable Rank | Column headers with links are sortable On Call | Column headers with links are sortable Vehicle | Column headers with links are sortable Uniform |
Column heading unavailable
|
|---|---|---|---|---|---|---|---|
| Leela | 0 | Planet Express | 2 | false | Old Bessie | md |
|
| Fry | 1 | Planet Express | 4 | true | none | lg |
|
| Bender | 2 | PlanEx | 3 | false | none |
|
|
| Mom | 3 | Mom Corp | 1 | true | any | sm |
|