Table

Renders a table with generic styling.

Read more Read less

Examples

<.table id="users" rows={@users}>
  <:col :let={user} label="id"><%= user.id %></:col>
  <:col :let={user} label="username"><%= user.username %></:col>
</.table>
Id User name Actions
1 jose
2 chris
<.table id="table-single-table" rows={[
  %User{id: 1, username: "jose"},
  %User{id: 2, username: "chris"}
]
}>
  <:col :let={user} label="Id">
    <%= user.id %>
  </:col>
  <:col :let={user} label="User name">
    <%= user.username %>
  </:col>
  <:action><.button size="sm" variant="outline" class="mr-1">Edit</.button></:action>
</.table>