Class TableCellElement

java.lang.Object
com.vaadin.testbench.TestBenchElement
com.vaadin.flow.component.html.testbench.TableCellElement
All Implemented Interfaces:
CanCompareScreenshots, HasCallFunction, HasDriver, HasElementQuery, HasPropertySettersGetters, HasSearchContext, HasTestBenchCommandExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebElement, org.openqa.selenium.WrapsElement
Direct Known Subclasses:
TableDataCellElement, TableHeaderCellElement

public class TableCellElement extends TestBenchElement
A TestBench element representing either kind of table cell, a <td> or a <th>. It carries no @Element annotation of its own: it is the type TableRowElement.getCells() speaks in when the kind of cell does not matter, mirroring TableCell on the component side.
Since:
25.3
  • Constructor Details

    • TableCellElement

      public TableCellElement()
  • Method Details

    • getColspan

      public int getColspan()
      Returns the colspan of this cell, or 1 if it carries none. The value comes from the DOM property, so the browser has already applied the rules: an absent, negative or unparseable colspan reads as 1, and so does 0, that value having been dropped from HTML.
      Returns:
      the number of columns this cell covers, at least 1.
    • getRowspan

      public int getRowspan()
      Returns the rowspan of this cell as written, or 1 if it carries none. The value comes from the DOM property, so an absent, negative or unparseable rowspan reads as 1 ? but 0 is kept, since it is meaningful in HTML and means the cell reaches to the end of its row group. Use getResolvedRowspan() for the number of rows that works out to.
      Returns:
      the rowspan of this cell, where 0 means to the end of the row group.
    • getResolvedRowspan

      public int getResolvedRowspan()
      Returns how many rows this cell actually covers, which is what getRowspan() says only when the cell neither uses 0 nor reaches past the end of its row group. A rowspan of 0 resolves to the number of rows left in the <thead>, <tbody> or <tfoot> holding the cell, and a span longer than that group is cut off at its end, because a row span may not cross from one row group into the next.

      There is no counterpart for colspan: 0 is not a legal value for it, so getColspan() is already the number of columns covered.

      Returns:
      the number of rows this cell covers, at least 1.