Skip to content
Snippets Groups Projects
datatable.html 1.07 KiB
Newer Older
alexisben's avatar
alexisben committed
{{- $position := .position -}}
{{- $title := .title -}}
{{- with .data -}}
  <section class="block-datatable{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}">
    <div class="container">
      <div class="block-content">
        {{- if $title }}
          <div class="top">
            <h2>{{ partial "PrepareHTML" $title }}</h2>
          </div>
        {{ end -}}
        <div class="table-responsive">
          <table class="table">
            {{- if .caption }}
              <caption>{{ partial "PrepareHTML" .caption }}</caption>
            {{ end -}}
            <thead>
              <tr>
                {{ range .columns }}
                  <th scope="col">{{ . }}</th>
                {{ end }}
              </tr>
            </thead>

            <tbody>
              {{ range .rows }}
                <tr>
                  {{ range . }}
                    <td>{{ . }}</td>
                  {{ end }}
                </tr>
              {{ end }}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </section>
{{- end -}}