Class NativeTableCell

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

@Tag("td") public class NativeTableCell extends HtmlContainer implements ClickNotifier<NativeTableCell>
Component representing a <td> element.
Since:
24.4
See Also:
  • Constructor Details

    • NativeTableCell

      public NativeTableCell()
      Creates a new empty table cell component.
    • NativeTableCell

      public NativeTableCell(Component... components)
      Creates a new table cell with the given children components.
      Parameters:
      components - the children components.
    • NativeTableCell

      public NativeTableCell(String text)
      Creates a new table cell with the given text.
      Parameters:
      text - the text.
    • NativeTableCell

      public NativeTableCell(Signal<String> textSignal)
      Creates a new table cell with its text content bound to the given signal.

      While a binding for the text content is active, any attempt to set the text manually throws BindingActiveException. The same happens when trying to bind a new Signal while one is already bound.

      Bindings are lifecycle-aware and only active while this component is in the attached state; they are deactivated while the component is in the detached state.

      Parameters:
      textSignal - the signal to bind, not null
      Since:
      25.1
      See Also:
  • Method Details

    • setColspan

      public void setColspan(int colspan)
      Set the colspan of this cell.
      Parameters:
      colspan - a non-negative integer value that indicates how many columns the data cell spans or extends.
    • getColspan

      public int getColspan()
      Returns the colspan value of this cell.
      Returns:
      the current value of the colspan attribute. Default is 1.
    • resetColspan

      public void resetColspan()
      Reset colspan to its default value of 1.
    • setRowspan

      public void setRowspan(int rowspan)
      Sets the rowspan for this cell.
      Parameters:
      rowspan - a non-negative integer value that indicates for how many rows the data cell spans or extends. If its value is set to 0, it extends until the end of the table grouping section (<thead>, <tbody>, <tfoot>, even if implicitly defined), that the cell belongs to.
    • getRowspan

      public int getRowspan()
      Returns the rowspan value of this cell.
      Returns:
      the current value of the rowspan attribute. Default is 1.
    • resetRowspan

      public void resetRowspan()
      Resets the rowspan to its default value of 1.