Component Detail
Table
Column/row data table with sort affordances.
Example
References
- Template
templates/components/table.html- Golden
testdata/golden/table.golden.html
Go (Marionette) Example
This implementation example uses Marionette in Go. Source: docs/site-astro/public/examples/go/table.go
package goexamples
import (
mb "github.com/YoshihideShirai/marionette/backend"
mf "github.com/YoshihideShirai/marionette/frontend"
)
func RegisterTableExample(app *mb.App) {
app.Page("/table", func(ctx *mb.Context) mf.Node {
return mf.Table(mf.TableProps{
Columns: []mf.TableColumn{{Label: "Name"}, {Label: "Role"}},
Rows: []mf.TableComponentRow{
mf.TableRowValues("Aiko Tanaka", mf.Badge(mf.BadgeProps{Label: "Admin"})),
mf.TableRowValues("Ren Sato", mf.Badge(mf.BadgeProps{Label: "Editor"})),
},
})
})
}