AnthoLume/templates/components/table.tmpl

33 lines
876 B
Cheetah
Raw Permalink Normal View History

2024-05-26 00:04:26 +00:00
{{ $rows := .Rows }}
{{ $cols := .Columns }}
{{ $keys := .Keys }}
<table class="min-w-full leading-normal bg-white dark:bg-gray-700 text-sm">
<thead class="text-gray-800 dark:text-gray-400">
<tr>
{{ range $col := $cols }}
2024-06-16 21:11:03 +00:00
<th
class="p-3 font-normal text-left uppercase border-b border-gray-200 dark:border-gray-800"
>
{{ $col }}
</th>
2024-05-26 00:04:26 +00:00
{{ end }}
</tr>
</thead>
<tbody class="text-black dark:text-white">
{{ if not $rows }}
2024-06-16 21:11:03 +00:00
<tr>
<td class="text-center p-3" colspan="4">No Results</td>
</tr>
2024-05-26 00:04:26 +00:00
{{ end }}
{{ range $row := $rows }}
2024-06-16 21:11:03 +00:00
<tr>
{{ range $key := $keys }}
<td class="p-3 border-b border-gray-200">
{{ template "table-cell" (dict "Data" $row "Name" $key ) }}
</td>
{{ end }}
</tr>
2024-05-26 00:04:26 +00:00
{{ end }}
</tbody>
</table>