com.vaadin.flow.component.html.

Class NativeTableRow

All Implemented Interfaces:

AttachNotifier, ClickNotifier<NativeTableRow>, DetachNotifier, HasComponents, HasElement, HasEnabled, HasOrderedComponents, HasSize, HasStyle, HasText, Serializable

@Tag("tr") public class NativeTableRow extends HtmlContainer implements HasOrderedComponents, ClickNotifier<NativeTableRow>

Component representing a <tr> element.

Since:

24.4

See Also:

  • Constructor Details

    • NativeTableRow

      public NativeTableRow()

      Creates a new empty table row component.

    • NativeTableRow

      public NativeTableRow(Component... components)

      Creates a new table row with the given children components.

      Parameters:

      components - the children components.

  • Method Details

    • addHeaderCell

      public NativeTableHeaderCell addHeaderCell()

      Add a header cell to this row.

      Returns:

      the new <th> element.

    • insertHeaderCell

      public NativeTableHeaderCell insertHeaderCell(int position)

      Insert a new header cell into a given position.

      Parameters:

      position - the position into which the header cell must be added.

      Returns:

      the new header cell.

    • addDataCell

      public NativeTableCell addDataCell()

      Add a data cell to this row.

      Returns:

      the new <td> element.

    • insertDataCell

      public NativeTableCell insertDataCell(int position)

      Insert a new data cell into a given position.

      Parameters:

      position - the position into which the data cell must be added.

      Returns:

      the new data cell.

    • getHeaderCells

      public List<NativeTableHeaderCell> getHeaderCells()

      Returns a list of all header cells in this row.

      Returns:

      A list of all header cells in this row.

    • getDataCells

      public List<NativeTableCell> getDataCells()

      Returns a list of all data cells in this row.

      Returns:

      A list of all data cells in this row.

    • getAllCells

      public List<Component> getAllCells()

      Returns a list of all cells in this row.

      Returns:

      a list of all cells in this row.

    • getHeaderCell

      public Optional<NativeTableHeaderCell> getHeaderCell(int index)

      Returns the header cell at a given position relative to other header cells.

      Parameters:

      index - the position of the header cell relative to other header cells.

      Returns:

      the header cell at the given position (relative to other header cells).

    • getDataCell

      public Optional<NativeTableCell> getDataCell(int index)

      Returns the data cell at a given position relative to other data cells.

      Parameters:

      index - the position of the data cell relative to other data cells.

      Returns:

      the data cell at the given position (relative to other data cells).

    • getCell

      public Optional<Component> getCell(int index)

      Returns the cell at a given position.

      Parameters:

      index - the position of the cell.

      Returns:

      the cell at the given position

      Throws:

      IndexOutOfBoundsException - if index is negative or greater than (or equal to) the number of cells in the row

    • removeCell

      public void removeCell(int index)

      Removes the cell at a given position.

      Parameters:

      index - the position of the cell to remove

    • removeHeaderCell

      public void removeHeaderCell(int index)

      Removes the header cell at a position relative to other header cells.

      Parameters:

      index - the position of the header cell relative to other header cells.

    • removeHeaderCell

      public void removeHeaderCell(NativeTableHeaderCell headerCell)

      Removes a header cell.

      Parameters:

      headerCell - the header cell to remove.

    • removeDataCell

      public void removeDataCell(int index)

      Removes the data cell at a given position relative to other data cells.

      Parameters:

      index - the position of the data cell to remove relative to other data cells.

    • removeDataCell

      public void removeDataCell(NativeTableCell dataCell)

      Removes a data cell.

      Parameters:

      dataCell - the data cell to remove.