From 73e65f2014606a812ce362e3bdb75affa153e51b Mon Sep 17 00:00:00 2001 From: Francesco Date: Fri, 18 Apr 2025 11:15:18 +0200 Subject: [PATCH] Add proper table rendering --- assets/css/main.css | 5 +++ layouts/_default/_markup/render-table.html | 44 ++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 layouts/_default/_markup/render-table.html diff --git a/assets/css/main.css b/assets/css/main.css index b2a95af..7ae1fce 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -559,6 +559,11 @@ figcaption { /* Tables */ +.table-outer { + width: 100%; + overflow-x: auto; +} + table { border-collapse: collapse; margin-top: var(--table-margin-top); diff --git a/layouts/_default/_markup/render-table.html b/layouts/_default/_markup/render-table.html new file mode 100644 index 0000000..5534d3a --- /dev/null +++ b/layouts/_default/_markup/render-table.html @@ -0,0 +1,44 @@ +{{/* +Default table rendered plus an outer div to align and overflow tables +accordingly. +Ref: https://gohugo.io/render-hooks/tables/ +*/}} +
+ + + {{- range .THead }} + + {{- range . }} + + {{- end }} + + {{- end }} + + + {{- range .TBody }} + + {{- range . }} + + {{- end }} + + {{- end }} + +
+ {{- .Text -}} +
+ {{- .Text -}} +
+
\ No newline at end of file