[]
ITable. An ITableRow object is a member of the ITableRows collection and corresponds to a single data row in a table. You can use it to access the row index, obtain the row range, or delete the row from the table.
worksheet.getRange("A1:B3").setValue(new Object[][] {{"Name", "Value"}, {"A", 1}, {"B", 2}});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
ITableRow tableRow = table.getRows().get(0);
IRange range = tableRow.getRange();
voiddelete()intgetIndex()ITableRow within the ITableRows collection.getRange()IRange object that represents the range occupied by this table row.ITableRow within the ITableRows collection.Use this method to determine the position of a data row in the table's row collection.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"A", 100},
{"B", 200}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
ITableRow row = table.getRows().get(1);
int index = row.getIndex();
ITableRow within the ITableRows collection.IRange object that represents the range occupied by this table row.The returned range corresponds to the cells occupied by the current data row within its parent ITable.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100},
{"Demo", 200}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
ITableRow row = table.getRows().get(0);
IRange range = row.getRange();
IRange object that represents the range occupied by this table row.Use this method to remove a data row from a ITable. The deleted row is removed from the table's data rows, and the remaining cells below it are shifted up.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"Apple", 100},
{"Orange", 200}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"), true);
ITableRow row = table.getRows().get(0);
row.delete();