Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pure_table.html « shortcodes « layouts - github.com/heyeshuang/hugo-theme-tokiwa.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 91236bcf117922845bb04eaf8df8407c7a476c82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{{ $fields := (index .Params 0) }}
{{ $data := after 1 .Params }}

<table class="pure-table pure-table-striped">
  <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>