Class Col


@Marshalled(typeName="col") public class Col extends HtmlElementVoid<Col>
DTO for an HTML <col> element.

The col element represents one or more columns in a column group represented by its parent colgroup element. It is used to define the structural columns of a table and can specify attributes that apply to all cells in those columns. The col element is a void element that does not contain any content and is typically used within a colgroup element to define column properties such as width, alignment, and styling.

Examples:

import static org.apache.juneau.bean.html5.HtmlBuilder.*; // Simple column Col simple = col(); // Column spanning multiple columns Col spanning = col().span(3); // Column with styling Col styled = col() .class_("highlight-column") .style("background-color: #f0f0f0;"); // Column with width Col withWidth = col() .style("width: 200px;"); // Column with alignment Col aligned = col() .style("text-align: center;"); // Column with ID Col withId = col() .id("name-column") .span(2); // Column with multiple attributes Col complex = col() .span(2) .class_("data-column") .style("width: 150px; text-align: right;") .title("Numeric data column");

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

See Also:
  • Constructor Details

    • Col

      public Col()
      Creates an empty Col element.
    • Col

      public Col(Number span)
      Creates a Col element with the specified span(Object) attribute.
      Parameters:
      span - The span(Object) attribute. Can be null to unset the attribute.
  • Method Details

    • span

      public Col span(Object value)
      span attribute.

      Number of columns spanned by the element.

      Parameters:
      value - The new value for this attribute. Typically a Number or String. Can be null to unset the attribute.
      Returns:
      This object.