Class Table

java.lang.Object
org.patternfly.component.BaseComponent<elemental2.dom.HTMLTableElement, Table>
org.patternfly.component.table.Table
All Implemented Interfaces:
Iterable<Tbody>, Attachable, ElementAttributeMethods<elemental2.dom.HTMLTableElement, Table>, ElementClassListMethods<elemental2.dom.HTMLTableElement, Table>, ElementConsumerMethods<elemental2.dom.HTMLTableElement, Table>, ElementContainerMethods<elemental2.dom.HTMLTableElement, Table>, ElementEventMethods<elemental2.dom.HTMLTableElement, Table>, ElementIdMethods<elemental2.dom.HTMLTableElement, Table>, ElementQueryMethods<elemental2.dom.HTMLTableElement>, HTMLElementAttributeMethods<elemental2.dom.HTMLTableElement, Table>, HTMLElementDataMethods<elemental2.dom.HTMLTableElement, Table>, HTMLElementStyleMethods<elemental2.dom.HTMLTableElement, Table>, HTMLElementVisibilityMethods<elemental2.dom.HTMLTableElement, Table>, IsElement<elemental2.dom.HTMLTableElement>, TypedBuilder<elemental2.dom.HTMLTableElement, Table>, Component, HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>, OuiaSupport<elemental2.dom.HTMLTableElement, Table>, Modifiers.Compact<elemental2.dom.HTMLTableElement, Table>, Modifiers.Plain<elemental2.dom.HTMLTableElement, Table>

public class Table extends BaseComponent<elemental2.dom.HTMLTableElement, Table> implements Attachable, Modifiers.Compact<elemental2.dom.HTMLTableElement, Table>, HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>, Modifiers.Plain<elemental2.dom.HTMLTableElement, Table>
A table is used to display large data sets that can be easily laid out in a simple grid with column headers.
See Also:
  • Method Details

    • table

      public static Table table()
    • table

      public static Table table(TableType type)
    • attach

      public void attach(elemental2.dom.MutationRecord mutationRecord)
      Specified by:
      attach in interface Attachable
    • addCaption

      public Table addCaption(TableCaption caption)
    • addHead

      public Table addHead(Thead head)
    • addBody

      public Table addBody(Tbody tbody)
    • add

      public Table add(Tbody tbody)
      Description copied from interface: HasItems
      Adds an item to the component.
      Specified by:
      add in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Parameters:
      tbody - the item to be added to the component
      Returns:
      the builder instance after the item has been added
    • stickyHeader

      public Table stickyHeader()
    • stickyHeader

      public Table stickyHeader(boolean stickyHeader)
    • noBorders

      public Table noBorders()
    • noBorders

      public Table noBorders(boolean borders)
    • gridBreakpoint

      public Table gridBreakpoint(GridBreakpoint breakpoint)
    • selectionMode

      public Table selectionMode(SelectionMode selectionMode)
      Sets the selection mode for the table. If not set, the table does not support selection.
      Parameters:
      selectionMode - the SelectionMode that specifies how rows are selected in the table. Supported modes include:
      • single - Only a single item can be selected at any time.
      • multi - Multiple items can be selected simultaneously.
      If an unsupported mode is provided, the method will not update the current selection mode.
      Returns:
      the current Table instance to allow for method chaining.
    • treeViewGridBreakpoint

      public Table treeViewGridBreakpoint(TreeViewGridBreakpoint breakpoint)
    • that

      public Table that()
      Specified by:
      that in interface TypedBuilder<elemental2.dom.HTMLTableElement, Table>
    • ariaLabel

      public Table ariaLabel(String label)
    • onAdd

      public Table onAdd(AddItemHandler<Table,Tbody> onAdd)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever a new item is added to the component.
      Specified by:
      onAdd in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Parameters:
      onAdd - a AddItemHandler that takes the builder instance and the item being added as arguments
      Returns:
      the builder instance after adding the callback
    • onUpdate

      public Table onUpdate(UpdateItemHandler<Table,Tbody> onUpdate)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is updated in the component.
      Specified by:
      onUpdate in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Parameters:
      onUpdate - a UpdateItemHandler that takes the component, the previous state of the item, and the updated state of the item as arguments
      Returns:
      the builder instance after adding the callback
    • onRemove

      public Table onRemove(RemoveItemHandler<Table,Tbody> onRemove)
      Description copied from interface: HasItems
      Registers a callback to be invoked whenever an item is removed from the component.
      Specified by:
      onRemove in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Parameters:
      onRemove - a RemoveItemHandler that takes the component and the item being removed as arguments
      Returns:
      the builder instance after adding the callback
    • onSingleSelect

      public Table onSingleSelect(SelectHandler<Tr> selectHandler)
    • onMultiSelect

      public Table onMultiSelect(MultiSelectHandler<Table,Tr> selectHandler)
    • iterator

      public Iterator<Tbody> iterator()
      Specified by:
      iterator in interface Iterable<Tbody>
    • size

      public int size()
      Description copied from interface: HasItems
      Retrieves the total number of items currently contained in the component.
      Specified by:
      size in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Returns:
      the number of items contained in the component
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: HasItems
      Checks whether the collection of items in the component is empty.
      Specified by:
      isEmpty in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Returns:
      true if the component contains no items; false otherwise
    • contains

      public boolean contains(String identifier)
      Description copied from interface: HasItems
      Checks whether the component contains an item associated with the given identifier.
      Specified by:
      contains in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Parameters:
      identifier - the identifier of the item to be checked
      Returns:
      true if the component contains an item associated with the provided identifier, false otherwise
    • item

      public Tbody item(String identifier)
      Description copied from interface: HasItems
      Retrieves the item associated with the specified identifier from the component.
      Specified by:
      item in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Parameters:
      identifier - the identifier of the item to be retrieved
      Returns:
      the item associated with the given identifier, or null if no item is found
    • updateItem

      public void updateItem(Tbody item)
      Description copied from interface: HasItems
      Updates an existing item in the component.
      Specified by:
      updateItem in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Parameters:
      item - the item to be updated
    • removeItem

      public void removeItem(String identifier)
      Description copied from interface: HasItems
      Removes an item from the component based on the provided identifier.
      Specified by:
      removeItem in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
      Parameters:
      identifier - the identifier of the item to be removed
    • clear

      public void clear()
      Description copied from interface: HasItems
      Clears all items from the component. This method removes any existing items within the component, leaving it empty. Any associated or registered callbacks related to the removal of items may be invoked as part of this operation.
      Specified by:
      clear in interface HasItems<elemental2.dom.HTMLTableElement, Table, Tbody>
    • reset

      public void reset()
    • select

      public void select(String identifier)
    • select

      public void select(String identifier, boolean selected)
    • select

      public void select(String identifier, boolean selected, boolean fireEvent)
    • select

      public void select(Tr item)
    • select

      public void select(Tr item, boolean selected)
    • select

      public void select(Tr item, boolean selected, boolean fireEvent)
    • selectAll

      public void selectAll()
    • selectAll

      public void selectAll(boolean fireEvent)
    • selectNone

      public void selectNone()
    • selectNone

      public void selectNone(boolean fireEvent)
    • selectedItems

      public List<Tr> selectedItems()
    • thead

      public Thead thead()
    • tbody

      public Tbody tbody()