Class Colgroup


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

The colgroup element represents a group of one or more columns in a table. It is used to define structural columns and can specify attributes that apply to all cells in those columns. The colgroup element can contain col elements to define individual columns, or it can use the span attribute to define a group of columns without explicitly listing each one. This element is typically placed immediately after the opening table tag and before any thead, tbody, or tr elements.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple column group Colgroup simple = colgroup(); // Column group with span Colgroup withSpan = colgroup().span(3); // Column group with individual columns Colgroup withColumns = colgroup( col().span(2), col().span(1) ); // Column group with styling Colgroup styled = colgroup() ._class("header-columns") .style("background-color: #f0f0f0;"); // Column group with multiple columns Colgroup multiple = colgroup( col()._class("name-column").style("width: 200px;"), col()._class("age-column").style("width: 100px;"), col()._class("city-column").style("width: 150px;") ); // Column group with alignment Colgroup aligned = colgroup( col().style("text-align: left;"), col().style("text-align: center;"), col().style("text-align: right;") ); // Column group with ID Colgroup withId = colgroup() .id("data-columns") .span(4);

The following convenience methods are provided for constructing instances of this bean:

See Also: