summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-09-23 11:44:02 +0800
committerEltrac <hi@guhub.cn>2025-09-23 11:44:02 +0800
commit11caee3b10208199604d3b3d4f3dbb3a2ca9c7b3 (patch)
tree08ac5ff9af9335cb409850116a8494c356a83aef /layouts
parent014035e7f31a19240d91586d0c6cc7bbc31a66b9 (diff)
refactor: style tables with UnoCSS
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_markup/render-table.html20
1 files changed, 14 insertions, 6 deletions
diff --git a/layouts/_markup/render-table.html b/layouts/_markup/render-table.html
index 75196aeb..010942f0 100644
--- a/layouts/_markup/render-table.html
+++ b/layouts/_markup/render-table.html
@@ -1,11 +1,16 @@
-<div class="table-container">
- <table>
+<div class="overflow-x-auto">
+ <table class="border-collapse w-max min-w-full table-fixed
+ b-t-2 b-t-solid b-t-[var(--border-color)]"
+ style="-webkit-overflow-scrolling: touch;">
{{- if .THead }}
<thead>
{{- range .THead }}
- <tr>
+ <tr class="b-t-1 b-t-solid b-t-[var(--border-color)]">
{{- range . }}
- <th{{ with .Alignment }} style="text-align:{{ . }}"{{ end }}>{{ .Text | safeHTML }}</th>
+ <th
+ class="max-w-[200px] py-2 px-4 leading-snug whitespace-normal break-words"
+ {{ with .Alignment }} style="text-align:{{ . }}"{{ end }}
+ >{{ .Text | safeHTML }}</th>
{{- end }}
</tr>
{{- end }}
@@ -13,9 +18,12 @@
{{- end }}
<tbody>
{{- range .TBody }}
- <tr>
+ <tr class="b-t-1 b-t-solid b-t-[var(--border-color)]">
{{- range . }}
- <td{{ with .Alignment }} style="text-align:{{ . }}"{{ end }}>{{ .Text | safeHTML }}</td>
+ <td
+ class="max-w-[200px] py-2 px-4 leading-snug whitespace-normal break-words"
+ {{ with .Alignment }} style="text-align:{{ . }}"{{ end }}
+ >{{ .Text | safeHTML }}</td>
{{- end }}
</tr>
{{- end }}