[]
ITable objects in a worksheet.Each ITable object represents a table in the worksheet. Use this interface to access existing tables, add new tables, and enumerate the tables returned by IWorksheet.getTables().
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"Test", 100}
});
ITables tables = worksheet.getTables();
ITable table = tables.add(worksheet.getRange("A1:B3"), true);
voidget(int index) ITable at the specified index.ITable with the specified name.intgetCount()ITable objects in this collection.toJson()forEach, iterator, spliteratorITable with the specified name.Use this method to retrieve an existing table from the collection returned by IWorksheet.getTables().
IRange range = worksheet.getRange("A1:B3");
range.setValue(new Object[][] {
{"Product", "Amount"},
{"Apple", 10},
{"Pear", 20}
});
ITable table = worksheet.getTables().add(range, true);
table.setName("SalesTable");
ITable namedTable = worksheet.getTables().get("SalesTable");
ITable at the specified index.Use this method to retrieve an existing table from the collection returned by IWorksheet.getTables().
IRange range = worksheet.getRange("A1:B3");
range.setValue(new Object[][] {
{"Name", "Value"},
{"Apple", 100},
{"Pear", 200}
});
worksheet.getTables().add(range, true);
ITable table = worksheet.getTables().get(0);
index - The zero-based index of the table to retrieve.ITable object at the specified index.ITable objects in this collection.Use this method to get the number of tables defined on the worksheet.
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Name", "Value"},
{"A", 100},
{"B", 200}
});
ITables tables = worksheet.getTables();
tables.add(worksheet.getRange("A1:B3"), true);
int count = tables.getCount();
ITable objects in this collection.Use this method to create a table from an existing worksheet range and add it to the collection returned by IWorksheet.getTables().
worksheet.getRange("A1:B3").setValue(new Object[][] {
{"Product", "Amount"},
{"Apple", 100},
{"Orange", 200}
});
ITable table = worksheet.getTables().add(worksheet.getRange("A1:B3"));
range - The cell range to include in the table; must not be null.ITable object.Use this method to convert a worksheet range into a table. Set containsHeader to true when the first row in the range should be used as the table header row.
IRange range = worksheet.getRange("A1:B3");
range.setValue(new Object[][] {
{"Name", "Value"},
{"Apple", 100},
{"Pear", 200}
});
ITable table = worksheet.getTables().add(range, true);
range - The cell range to include in the table; must not be null.containsHeader - true if the first row of the range contains header cells; otherwise, false.ITable object.IllegalArgumentException - if range is null.
worksheet.getRange("A1:B3").setValue(new Object[][] {{"Name", "Value"}, {"A", 100}, {"B", 200}});
ITables tables = worksheet.getTables();
tables.add(worksheet.getRange("A1:B3"), true);
String json = tables.toJson();
tables.fromJson(json);
json - The JSON string used to load the table collection.
worksheet.getRange("A1:B3").setValue(new Object[][] {{"Name", "Value"}, {"A", 100}, {"B", 200}});
ITables tables = worksheet.getTables();
tables.add(worksheet.getRange("A1:B3"), true);
String json = tables.toJson();