add shading to table component

This commit is contained in:
2022-11-11 18:47:55 -05:00
parent a3e7e3a86d
commit 8231683958
5 changed files with 13 additions and 5 deletions

View File

@ -33,8 +33,8 @@
</tr>
</thead>
<tbody>
<%= for values <- @rows do %>
<tr>
<%= for {values, i} <- @rows |> Enum.with_index() do %>
<tr class={if i |> Integer.is_even(), do: @row_class, else: @alternate_row_class}>
<%= for %{key: key} = value <- @columns do %>
<td class={"p-2 #{value[:class]}"}>
<%= case values |> Map.get(key) do %>