public class Table extends HTMLTag
Constructor and Description |
---|
Table() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addRow(Row row) |
Cell |
getCell(int row,
int column)
Gets the cell at the specified row and column
|
Cell |
getHeaderForCell(int row,
int column)
Gets the header cell for the specified row and column.
|
int |
getNumColumns()
Returns the number of columns in the table
|
int |
getNumRows()
Returns the number of rows in the table
|
Row |
getRow(int row)
Gets the row with the given row number (0 based)
|
java.util.List<Row> |
getRows()
Returns the rows of the table
|
static Table |
parseTable(java.lang.String htmlTable)
Parses the given html into a table
|
addAttribute, getAttribute, getAttributeNames, getAttributes, hasAttribute
@Nullable @RequiredVersion(value=1) @Contract(value="null -> null; !null -> !null") public static Table parseTable(@Nullable java.lang.String htmlTable)
htmlTable
- The html of the table (needs the surrounding table tags to be present)java.lang.IllegalArgumentException
- If the html can't be parsed into a tablepublic int getNumRows()
public int getNumColumns()
@NotNull public java.util.List<Row> getRows()
public Row getRow(int row)
row
- The row offset (0 based)Row
@Nullable public Cell getCell(int row, int column)
row
- The index of the row to get (0 based)column
- The index of the column to get (0 based)java.lang.ArrayIndexOutOfBoundsException
- If either the row or column index is outside the bounds of the table@Nullable public Cell getHeaderForCell(int row, int column)
row
- The index of the row for which to get a header cell (0 based)column
- The index of the column for which to get a header cell (0 based)java.lang.ArrayIndexOutOfBoundsException
- If either the row or column index is outside the bounds of the table