From 91d08a141b17cc509e07ebeaa02d986b0d20fce6 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Fri, 22 Oct 2021 02:38:58 -0400 Subject: themes/hugo-pt2021/layout/shortcodes/table.html: fix column header alignment --- themes/hugo-pt2021/layouts/shortcodes/table.html | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'themes/hugo-pt2021/layouts') 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. {{- 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 -}} +