Class NativeTable

All Implemented Interfaces:
AttachNotifier, ClickNotifier<NativeTable>, DetachNotifier, HasComponents, HasComponentsOfType<Component>, HasElement, HasEnabled, HasSize, HasStyle, HasText, Serializable

@Deprecated(since="25.3", forRemoval=true) @Tag("table") public class NativeTable extends HtmlContainer implements ClickNotifier<NativeTable>
Deprecated, for removal: This API element is subject to removal in a future version.
since 25.3, scheduled for removal in Vaadin 26. Use Table instead. It does not extend HtmlContainer, so it has no generic add(Component) and cannot be given children the HTML specification does not allow inside a <table>; it keeps the caption, column groups and sections in the order the specification requires whatever order they are added in; and it carries a good deal more API, including <colgroup> and <col> support, row and cell factories that set scope, colspan and rowspan, and binding a section's rows to a signal.
Component representing a <table> element.
Since:
24.5
See Also:
  • Constructor Details

    • NativeTable

      public NativeTable()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new empty table.
    • NativeTable

      public NativeTable(Component... components)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a new table with the given children components.
      Parameters:
      components - the children components.
  • Method Details

    • getCaption

      public NativeTableCaption getCaption()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the table's caption component. Creates a new instance if no caption is present.
      Returns:
      the table's caption.
    • getCaptionText

      public String getCaptionText()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the caption text for this table.
      Returns:
      the table's caption text.
    • setCaptionText

      public void setCaptionText(String text)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the caption text for this table.
      Parameters:
      text - the caption's text
    • removeCaption

      public void removeCaption()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove the caption from this table.
    • getHead

      public NativeTableHeader getHead()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Remove the head from this table, if present.
    • getFoot

      public NativeTableFooter getFoot()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes the foot from this table, if present.
    • getBodies

      public List<NativeTableBody> getBodies()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the list of <tbody> elements in this table.
      Returns:
      the list of table body elements of this table.
    • getBody

      public NativeTableBody getBody()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      public NativeTableBody getBody(int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      public NativeTableBody addBody()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a new body element to the table.
      Returns:
      The new body.
    • removeBody

      public void removeBody(NativeTableBody body)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes a body element from the table.
      Parameters:
      body - The body component to remove.
    • removeBody

      public void removeBody(int index)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes a body element at a given position.
      Parameters:
      index - The position of the body element to remove.
    • removeBody

      public void removeBody()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes the first body element in the list of bodies of this table.