Package com.vaadin.flow.component.html
Class TableHeaderCell
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.TableCell
com.vaadin.flow.component.html.TableHeaderCell
- All Implemented Interfaces:
AttachNotifier,ClickNotifier<TableHeaderCell>,DetachNotifier,HasComponents,HasComponentsOfType<Component>,HasElement,HasEnabled,HasSize,HasStyle,HasText,Serializable
@NullMarked
@Tag("th")
public class TableHeaderCell
extends TableCell
implements ClickNotifier<TableHeaderCell>
Component representing a
<th> element ? a header cell that
labels a row or a column of a Table.- Since:
- 25.3
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the cells that a<th>header relates to ? effectively the answer to "which other cells does this header label?".Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
HasText.WhiteSpace -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty header cell.TableHeaderCell(Component... components) Creates a new header cell with the given children.TableHeaderCell(Signal<String> textSignal) Creates a new header cell with its text content bound to the given signal.TableHeaderCell(String text) Creates a new header cell with the given text.TableHeaderCell(List<? extends Component> components) List equivalent ofTableHeaderCell(Component...). -
Method Summary
Modifier and TypeMethodDescriptiongetScope()Returns thescopeattribute value, if set.voidsetScope(@Nullable TableHeaderCell.Scope scope) Sets thescopeattribute, declaring which cells this header labels.Methods inherited from class com.vaadin.flow.component.html.TableCell
getColspan, getHeaderIds, getRowspan, hasColspan, hasRowspan, resetColspan, resetHeaders, resetRowspan, setColspan, setHeaderIds, setHeaderIds, setHeaders, setHeaders, setRowspanMethods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods 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, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.ClickNotifier
addClickListener, addClickShortcut, addDoubleClickListener, addSingleClickListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
addMethods inherited from interface com.vaadin.flow.component.HasComponentsOfType
add, add, addComponentAsFirst, addComponentAtIndex, bindChildren, getChildren, getComponentAt, getComponentCount, indexOf, remove, remove, removeAll, replaceMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasText
bindText, getText, getWhiteSpace, setText, setWhiteSpace
-
Constructor Details
-
TableHeaderCell
public TableHeaderCell()Creates a new empty header cell. -
TableHeaderCell
Creates a new header cell with the given children.- Parameters:
components- the children components.
-
TableHeaderCell
List equivalent ofTableHeaderCell(Component...).- Parameters:
components- the children components.
-
TableHeaderCell
Creates a new header cell with the given text.- Parameters:
text- the text.
-
TableHeaderCell
Creates a new header cell with its text content bound to the given signal.- Parameters:
textSignal- the signal to bind, notnull- See Also:
-
-
Method Details
-
setScope
Sets thescopeattribute, declaring which cells this header labels. Critical for accessibility ? screen readers use this to announce the right header when a user navigates into a data cell. Passnullto remove the attribute (browsers will then infer scope from structure).- Parameters:
scope- the scope, ornullto clear the attribute.- See Also:
-
getScope
Returns thescopeattribute value, if set.- Returns:
- the scope wrapped in an
Optional, or empty if unset (or the value is unrecognized).
-