Class TableColumn

All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasElement, HasSize, HasStyle, TableColumnSpan, Serializable

@NullMarked @Tag("col") public class TableColumn extends HtmlComponent implements TableColumnSpan
Component representing a <col> element ? a column (or range of columns, via TableColumnSpan.setSpan(int)) inside a TableColumnGroup. Use it to apply column-wide styling without repeating it on every cell: a class or id on a <col> can target all the data cells in that column.

<col> is a void element (no children, no end tag) and is only valid inside a <colgroup> that does not itself carry a span attribute. Only a limited subset of CSS applies to columns: background, border (with border-collapse: collapse), visibility: collapse and width. Text and font properties do not inherit into the cells ? style those on <td> or <th> instead.

Since:
25.3
See Also:
  • Constructor Details

    • TableColumn

      public TableColumn()
      Creates a new column component spanning a single column.
    • TableColumn

      public TableColumn(int span)
      Creates a new column component spanning the given number of columns.
      Parameters:
      span - the number of consecutive columns this <col> element applies to. Must be a positive integer.