aboutsummaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
Diffstat (limited to 'themes')
-rw-r--r--themes/hugo-pt2021/layouts/shortcodes/table.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/themes/hugo-pt2021/layouts/shortcodes/table.html b/themes/hugo-pt2021/layouts/shortcodes/table.html
index 907ef44..7fa30cc 100644
--- a/themes/hugo-pt2021/layouts/shortcodes/table.html
+++ b/themes/hugo-pt2021/layouts/shortcodes/table.html
@@ -148,7 +148,23 @@ you can override the `class` attribute for individual cells.
<thead>
<tr>
{{- range $x, $col := $table.cols -}}
+ {{/* set default css */}}
+ {{- $css := "" -}}
+
+ {{/* get alignment */}}
+ {{- $align := default "" $col.align -}}
+ {{- if eq $align "left" -}}
+ {{- $css = $config.cell_align_left -}}
+ {{- else if eq $align "center" -}}
+ {{- $css = $config.cell_align_center -}}
+ {{- else if eq $align "justified" -}}
+ {{- $css = $config.cell_align_justified -}}
+ {{- else if eq $align "right" -}}
+ {{- $css = $config.cell_align_right -}}
+ {{- end -}}
+
<th
+ {{if $css}} class='{{- $css -}}'{{- end}}
title='{{- default $col.name $col.tip -}}'
aria-label='{{- default $col.name $col.tip -}}'
data-{{- $dp -}}th_x='{{- $x -}}'