Skip to content

Commit eb56400

Browse files
authored
feat(tables): add the _header attribute for tables, hide the header if false (#238)
1 parent 1abed5e commit eb56400

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

layouts/_default/_markup/render-table.html

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,21 @@
6060
{{- with .Attributes._caption }}
6161
<caption>{{ . }}</caption>
6262
{{- end }}
63-
<thead
64-
{{ with $theadClass }}class="{{ delimit . ` ` }}"{{ end }}>
65-
{{- range .THead }}
66-
<tr>
67-
{{- range . }}
68-
<th
69-
{{ with index $alignmentClasses .Alignment }}class="{{ . }}"{{ end }}>
70-
{{- .Text -}}
71-
</th>
72-
{{- end }}
73-
</tr>
74-
{{- end }}
75-
</thead>
63+
{{- if default true .Attributes._header }}
64+
<thead
65+
{{ with $theadClass }}class="{{ delimit . ` ` }}"{{ end }}>
66+
{{- range .THead }}
67+
<tr>
68+
{{- range . }}
69+
<th
70+
{{ with index $alignmentClasses .Alignment }}class="{{ . }}"{{ end }}>
71+
{{- .Text -}}
72+
</th>
73+
{{- end }}
74+
</tr>
75+
{{- end }}
76+
</thead>
77+
{{- end }}
7678
<tbody
7779
{{ with $tbodyClass }}class="{{ delimit . ` ` }}"{{ end }}>
7880
{{- range .TBody }}

0 commit comments

Comments
 (0)