{{/* Adapted from https://gohugo.io/render-hooks/tables/ */}}

{{/* Ensure presence of `.table` class attribute to trigger Bootstrap styling */}}
{{ $attr := .Attributes }}
{{ $class := split $attr.class " " }}
{{ if not (in $class "table") }}
    {{ $attr = merge $attr (dict "class" (trim (delimit ($class | append "table") " ") " ")) }}
{{ end }}

{{ $wrap := in $class "table-wrap" }}
{{ $align := dict "left" "start" "center" "center" "right" "end" }}

{{ $header := "" }}
<table
  {{- range $k, $v := $attr