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

Body

A table caption shown above the table. Can be build with BootstrapViewElements.bootstrap.builders.body().

Not set by default

Caption

A table caption shown above the table. Can be build with BootstrapViewElements.bootstrap.builders.caption().

Not set by default

Footer

A table caption shown above the table. Can be build with BootstrapViewElements.bootstrap.builders.footer().

Not set by default

Header

A table header that can be build with BootstrapViewElements.bootstrap.builders.header().

Not set by default

Row

A table row that can be build with BootstrapViewElements.bootstrap.builders.row().

Not set by default

Examples

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();