1
0
Fork 0
forked from goffee/core

develop #2

Merged
diana merged 2 commits from goffee/core:develop into develop 2024-10-14 17:22:06 -04:00
2 changed files with 29 additions and 0 deletions
Showing only changes of commit 1c1740d97b - Show all commits

View file

@ -0,0 +1,17 @@
package components
type ContentTable struct {
ID string
AllTH []ContentTableTH
AllTD [][]ContentTableTD
}
type ContentTableTH struct {
ID string
Value string
}
type ContentTableTD struct {
ID string
Value string
}

View file

@ -0,0 +1,12 @@
{{define "content_table"}}
<table class="table table-hover" {{ if .ID }}id="{{.ID}}"{{end}}>
<thead>
<tr>
{{range $index, $col := .AllTH}}<th {{ if .ID }}id="{{.ID}}"{{end}} scope="col">{{ $col.Value }}</th>{{end}}
</tr>
</thead>
<tbody>
{{range .AllTD}}<tr scope="row">{{range .}}<td {{ if .ID }}id="{{.ID}}"{{end}}>{{ .Value }}</td>{{end}}</tr>{{end}}
</tbody>
</table>
{{end}}