Closed dvic closed 8 months ago
What do you think about this approach for the Table component? https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#module-slot-attributes
copied from above:
<.dyn_table rows={[%{name: "Jane", age: "34"}, %{name: "Bob", age: "51"}]}> <:column :let={user} label="Name"> <%= user.name %> </:column> <:column :let={user} label="Age"> <%= user.age %> </:column> </.dyn_table>
instead of
<.table> <.tr> <.th>Name</.th> <.th>Age</.th> </.tr> <.tr> <.td>Jane</.td> <.td>34</.td> </.tr> <.tr> <.td>Bob</.td> <.td>51</.td> </.tr> </.table>
Maybe we should add this as a <.dyn_table> component? (as it's kind of meant for tables with dynamic columns and rows)
<.dyn_table>
@dvic this has been added to the Petal Development board:
https://github.com/orgs/petalframework/projects/2
Done in 1.9.0
I updated the existing table component - should be backwards compatible.
https://petal.build/components/table
What do you think about this approach for the Table component? https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#module-slot-attributes
copied from above:
instead of
Maybe we should add this as a
<.dyn_table>
component? (as it's kind of meant for tables with dynamic columns and rows)