Class TableColumn

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.html.TableColumn
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, TableColumnSpan, Serializable

@NullMarked @Tag("col") public class TableColumn extends com.vaadin.flow.component.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 Summary

    Constructors
    Constructor
    Description
    Creates a new column component spanning a single column.
    TableColumn(int span)
    Creates a new column component spanning the given number of columns.
  • Method Summary

    Methods inherited from class com.vaadin.flow.component.HtmlComponent

    getTitle, setTitle

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttached

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasSize

    bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.html.TableColumnSpan

    getSpan, hasSpan, resetSpan, setSpan
  • 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.