From eb56400a29c8e56120f5b60ee13ad09ec23931dc Mon Sep 17 00:00:00 2001 From: Razon Yang Date: Thu, 5 Sep 2024 19:07:51 +0800 Subject: [PATCH] feat(tables): add the _header attribute for tables, hide the header if `false` (#238) --- layouts/_default/_markup/render-table.html | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/layouts/_default/_markup/render-table.html b/layouts/_default/_markup/render-table.html index 20175e0..4f27f2f 100644 --- a/layouts/_default/_markup/render-table.html +++ b/layouts/_default/_markup/render-table.html @@ -60,19 +60,21 @@ {{- with .Attributes._caption }} {{ . }} {{- end }} - - {{- range .THead }} - - {{- range . }} - - {{- .Text -}} - - {{- end }} - - {{- end }} - + {{- if default true .Attributes._header }} + + {{- range .THead }} + + {{- range . }} + + {{- .Text -}} + + {{- end }} + + {{- end }} + + {{- end }} {{- range .TBody }}