hugohm/layouts/shortcodes/csvTable.html

17 lines
354 B
HTML
Raw Permalink Normal View History

{{ $class := .Get "class" }}
{{ $file := .Get "file" }}
{{ $data := getCSV "," $file }}
<table class="{{ $class }}">
{{ range $row, $columns := $data }}
<tr>
{{ range $columns }}
{{ if eq $row 0 }}
<th> {{ . }}</th>
{{ else }}
<td> {{ . }}</td>
{{ end }}
{{ end }}
</tr>
{{ end }}
</table>