View Source PhoenixDuskmoon.Table (PhoenixDuskmoon v4.4.0)

Render table.

Link to this section Summary

Functions

Generates a table.

Link to this section Functions

Generates a table.

examples

Examples

<.dm_table data={[
  %{
    name: "Shmi Skywalker",
    portrayal: "Pernilla August (Episodes I-II)"
  },
  %{
    name: "Luke Skywalker",
    portrayal: "Mark Hamill (Episodes IV-IX, The Mandalorian, The Book of Boba Fett)"}
  ]}
>
  <:caption>Skywalker House</:catption>
  <:col :let={r} label="Name" label_class="text-teal-600" class="text-teal-400">
    <%= r.name %>
  </:col>
  <:col :let={r} label="Portrayal">
    <%= r.portrayal %>
  </:col>
</.dm_table>

attributes

Attributes

  • id (:any) - html attribute id. Defaults to false.
  • class (:any) - html attribute class. Defaults to "".
  • data (:list) - table data list. Defaults to [].

slots

Slots

  • caption - render a caption of table.Example
    <:caption>
      Table information
    </:caption>
    Accepts attributes:
    • id (:any) - table caption id.
    • class (:any) - table caption class.
  • col - render a column of table.Example
    <:col :let={r} label="Name">
      <%= r.name %>
    </:col>
    Accepts attributes:
    • label (:string) - table column title.
    • label_class (:any) - table column title title.
    • class (:any) - table row column class.