TableViewElement
A TableViewElement
writes a <table>
element to the output.
Element and builder
The TableViewElement
has an equivalent TableViewElementBuilder
.
A builder can be created using BootstrapViewElements.bootstrap.builders.table()
factory methods.
This builder holds nested builders for head, foot and body sections and can be found under BootstrapViewElements.bootstrap.builders.table
.
TableViewElement attributes
Attribute | Description | Default |
---|---|---|
|
A table caption shown above the table. Can be build with |
Not set by default |
|
A table caption shown above the table. Can be build with |
Not set by default |
|
A table caption shown above the table. Can be build with |
Not set by default |
|
A table header that can be build with |
Not set by default |
|
A table row that can be build with |
Not set by default |
Examples
Creating a table with header, body & footer
bootstrap.builders
.table()
.header(
bootstrap.builders.table.header().add(
bootstrap.builders.table.headerCell().text( "Name" )
).add(
bootstrap.builders.table.headerCell().text( "Value" )
)
)
.body(
bootstrap.builders.table.body().add(
bootstrap.builders.table.row().add(
bootstrap.builders.table.cell().text( "Height" )
).add(
bootstrap.builders.table.cell().text( "128" )
)
)
)
.footer(
bootstrap.builders.table.footer().add(
bootstrap.builders.table.row().add(
bootstrap.builders.table.cell()
.columnSpan( 2 )
.text( "Table footer" )
.heading( true )
)
)
)
.build();