Class Col


public class Col extends StyledElement<Col>
Represents an HTML <col> element for table column properties.

The Col element specifies column properties for each column within a Colgroup element. It is an empty element that only contains attributes and is used to apply styles to entire table columns.

Features:

  • Defines properties for table columns
  • Must be child of colgroup element
  • Span attribute to apply to multiple columns
  • Useful for styling entire columns

Usage:


 Colgroup colgroup = new Colgroup();
 colgroup.addCol(new Col());  // First column
 colgroup.addCol(new Col(2)); // Spans 2 columns
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Col

      public Col()
      Constructs an empty <col> element for a single column.
    • Col

      public Col(int span)
      Constructs a <col> element spanning multiple columns.
      Parameters:
      span - the number of columns this element should span
  • Method Details

    • setSpan

      public final Col setSpan(int colspan)
      Sets the number of columns this element should span.
      Parameters:
      colspan - The number of columns to span.
      Returns:
      This element for method chaining.