Skip to content

Commit

Permalink
feat(tables): add the _header attribute for tables, hide the header i…
Browse files Browse the repository at this point in the history
…f `false` (#238)
  • Loading branch information
razonyang authored Sep 5, 2024
1 parent 1abed5e commit eb56400
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions layouts/_default/_markup/render-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,21 @@
{{- with .Attributes._caption }}
<caption>{{ . }}</caption>
{{- end }}
<thead
{{ with $theadClass }}class="{{ delimit . ` ` }}"{{ end }}>
{{- range .THead }}
<tr>
{{- range . }}
<th
{{ with index $alignmentClasses .Alignment }}class="{{ . }}"{{ end }}>
{{- .Text -}}
</th>
{{- end }}
</tr>
{{- end }}
</thead>
{{- if default true .Attributes._header }}
<thead
{{ with $theadClass }}class="{{ delimit . ` ` }}"{{ end }}>
{{- range .THead }}
<tr>
{{- range . }}
<th
{{ with index $alignmentClasses .Alignment }}class="{{ . }}"{{ end }}>
{{- .Text -}}
</th>
{{- end }}
</tr>
{{- end }}
</thead>
{{- end }}
<tbody
{{ with $tbodyClass }}class="{{ delimit . ` ` }}"{{ end }}>
{{- range .TBody }}
Expand Down

0 comments on commit eb56400

Please sign in to comment.