View Source Phoenix.WebComponent.Table (Phoenix.WebComponent v3.2.4)
Render table.
Link to this section Summary
Functions
Generates a table.
Link to this section Functions
Generates a table.
examples
Examples
<.wc_table rows={[
%{
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)"}
]}>
<:col let={r} label="Name">
<%= r.name %>
</:col>
<:col let={r} label="Portrayal">
<%= r.portrayal %>
</:col>
</.wc_table>
attributes
Attributes
id
(:any
) - html attribute id. Defaults tofalse
.class
(:any
) - html attribute class. Defaults to""
.rows
(:list
) - table data list. Defaults to[]
.
slots
Slots
col
- render a column of table.Example
Accepts attributes:<:col let={r} label="Name"> <%= r.name %> </:col>
label
(:string
) - table column title.