gmgauthier.com/layouts/shortcodes/pure_table.html

23 lines
593 B
HTML

{{ $fields := (index .Params 0) }}
{{ $data := after 1 .Params }}
<span style="margin-left: auto; margin-right: auto; width: auto; padding: 5px">
<table class="pure-table pure-table-striped"
style=" text-align: justify; position: relative; width: fit-content; margin-left: 5%; margin-right: 5%;">
<thead><tr>
{{ range split $fields "|"}}
<th>{{ . }}</th>
{{ end }}
</thead></tr>
<tbody>
{{ range $data}}
<tr>
{{ $items := split . "|" }}
{{ range $items }}
<td>{{ . }}</td>
{{ end }}
</tr>
{{ end }}
</tbody>
</table>
</span>