summaryrefslogtreecommitdiff
path: root/layouts/_default/_markup/render-table.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-04-30 23:42:11 +0800
committerEltrac <hi@guhub.cn>2025-04-30 23:42:11 +0800
commit2db7b66b734b78cb273f6560e364d946038b85fc (patch)
treeab301b6d910fece3edfed4996a8fa663d178ece5 /layouts/_default/_markup/render-table.html
parent4ed06823920334eeea2e9e00c0fc45c3e2978888 (diff)
feat: responsive table
- allow horizontal scroll when not having enough space on X axis - maximun width for each cell
Diffstat (limited to 'layouts/_default/_markup/render-table.html')
-rw-r--r--layouts/_default/_markup/render-table.html24
1 files changed, 24 insertions, 0 deletions
diff --git a/layouts/_default/_markup/render-table.html b/layouts/_default/_markup/render-table.html
new file mode 100644
index 00000000..75196aeb
--- /dev/null
+++ b/layouts/_default/_markup/render-table.html
@@ -0,0 +1,24 @@
+<div class="table-container">
+ <table>
+ {{- if .THead }}
+ <thead>
+ {{- range .THead }}
+ <tr>
+ {{- range . }}
+ <th{{ with .Alignment }} style="text-align:{{ . }}"{{ end }}>{{ .Text | safeHTML }}</th>
+ {{- end }}
+ </tr>
+ {{- end }}
+ </thead>
+ {{- end }}
+ <tbody>
+ {{- range .TBody }}
+ <tr>
+ {{- range . }}
+ <td{{ with .Alignment }} style="text-align:{{ . }}"{{ end }}>{{ .Text | safeHTML }}</td>
+ {{- end }}
+ </tr>
+ {{- end }}
+ </tbody>
+ </table>
+</div>