-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtable.go
42 lines (38 loc) · 941 Bytes
/
table.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package components
import (
"github.com/maragudk/gomponents"
"github.com/maragudk/gomponents/html"
)
// Table is a table with a wrapper div.
//
// The styles are defined in a css file located where the
// tailwindcss css file is located.
func Table(children ...gomponents.Node) gomponents.Node {
return html.Div(
html.Class("table-wrapper"),
html.Table(
html.Class("table"),
gomponents.Group(children),
),
)
}
// TableSm is the same as Table, but with smaller padding.
func TableSm(children ...gomponents.Node) gomponents.Node {
return html.Div(
html.Class("table-wrapper"),
html.Table(
html.Class("table table-sm"),
gomponents.Group(children),
),
)
}
// TableLg is the same as Table, but with larger padding.
func TableLg(children ...gomponents.Node) gomponents.Node {
return html.Div(
html.Class("table-wrapper"),
html.Table(
html.Class("table table-lg"),
gomponents.Group(children),
),
)
}