Class Table


@Bean(typeName="table") public class Table extends HtmlElementContainer
DTO for an HTML <table> element.

The table element represents data with more than one dimension, in the form of a table. It contains rows and columns of data, with optional headers and footers. The table element is used to display tabular data in a structured format, making it easy to read and understand. It can contain caption, colgroup, thead, tbody, tfoot, and tr elements to organize the table structure.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple table with headers and data Table simple = table( thead( tr( th("Name"), th("Age"), th("City") ) ), tbody( tr( td("John"), td("25"), td("New York") ) ) ); // Table with caption and styling Table styled = table( caption("Employee Information"), thead( tr( th("ID"), th("Name"), th("Department") ) ) )._class("data-table").border(1); // Table with multiple sections Table complex = new Table() .children( new Caption().children("Sales Report"), new Thead() .children( new Tr() .children( new Th().children("Product"), new Th().children("Q1"), new Th().children("Q2") ) ), new Tbody() .children( new Tr() .children( new Td().children("Widget A"), new Td().children("100"), new Td().children("150") ) ), new Tfoot() .children( new Tr() .children( new Td().children("Total"), new Td().children("100"), new Td().children("150") ) ) );

See Also: