コンポーネント詳細
Table
Column/row data table with sort affordances.
サンプル
参照情報
- テンプレート
templates/components/table.html- ゴールデン
testdata/golden/table.golden.html
Go(Marionette)サンプル
この実装例は Go の Marionette を使っています。ソース: 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"})),
},
})
})
}