Package com.vaadin.flow.component.html
Class NativeTable
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.HtmlComponent
com.vaadin.flow.component.HtmlContainer
com.vaadin.flow.component.html.NativeTable
- All Implemented Interfaces:
AttachNotifier,ClickNotifier<NativeTable>,DetachNotifier,HasComponents,HasElement,HasEnabled,HasSize,HasStyle,HasText,Serializable
Component representing a
<table> element.- Since:
- 24.4
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasText
HasText.WhiteSpace -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty table.NativeTable(Component... components) Creates a new table with the given children components. -
Method Summary
Modifier and TypeMethodDescriptionaddBody()Adds a new body element to the table.Returns the list of<tbody>elements in this table.getBody()Returns the first body element in this table.getBody(int index) Returns the<tbody>element at a given position relative to other<tbody>elements.Return the table's caption component.Return the caption text for this table.getFoot()Returns the<tfoot>element of this table.getHead()Returns the head of this table.voidRemoves the first body element in the list of bodies of this table.voidremoveBody(int index) Removes a body element at a given position.voidremoveBody(NativeTableBody body) Removes a body element from the table.voidRemove the caption from this table.voidRemoves the foot from this table, if present.voidRemove the head from this table, if present.voidsetCaptionText(String text) Sets the caption text for this table.Methods inherited from class com.vaadin.flow.component.HtmlComponent
getTitle, setTitleMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods 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
add, add, add, addComponentAsFirst, addComponentAtIndex, remove, remove, removeAllMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
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, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasText
getText, getWhiteSpace, setText, setWhiteSpace
-
Constructor Details
-
NativeTable
public NativeTable()Creates a new empty table. -
NativeTable
Creates a new table with the given children components.- Parameters:
components- the children components.
-
-
Method Details
-
getCaption
Return the table's caption component. Creates a new instance if no caption is present.- Returns:
- the table's caption.
-
getCaptionText
Return the caption text for this table.- Returns:
- the table's caption text.
-
setCaptionText
Sets the caption text for this table.- Parameters:
text- the caption's text
-
removeCaption
public void removeCaption()Remove the caption from this table. -
getHead
Returns the head of this table.- Returns:
- This table's
<thead>element. Creates a new one if no element was present.
-
removeHead
public void removeHead()Remove the head from this table, if present. -
getFoot
Returns the<tfoot>element of this table.- Returns:
- The
<tfoot>element of this table. Creates a new one if none was present.
-
removeFoot
public void removeFoot()Removes the foot from this table, if present. -
getBodies
Returns the list of<tbody>elements in this table.- Returns:
- the list of table body elements of this table.
-
getBody
Returns the first body element in this table. Creates one if there's none.- Returns:
- the first
<tbody>element in the table. Creates one if there's none.
-
getBody
Returns the<tbody>element at a given position relative to other<tbody>elements.- Parameters:
index- The position of the body element relative to other body elements.- Returns:
- The table body component at the given position. If the position is 0 and there are no body elements present, a new one is created and returned.
-
addBody
Adds a new body element to the table.- Returns:
- The new body.
-
removeBody
Removes a body element from the table.- Parameters:
body- The body component to remove.
-
removeBody
public void removeBody(int index) Removes a body element at a given position.- Parameters:
index- The position of the body element to remove.
-
removeBody
public void removeBody()Removes the first body element in the list of bodies of this table.
-