[]
Provides access to built-in and custom ITableStyle objects in a workbook. Use this interface to retrieve table styles by name or index, check whether a style exists, or add a custom table style through Workbook.getTableStyles().
ITableStyleCollection tableStyles = workbook.getTableStyles();
ITableStyle customStyle = tableStyles.add("CustomStyle");
ITableStyle builtInStyle = tableStyles.get("TableStyleMedium3");
booleanget(int index) ITableStyle at the specified index.ITableStyle with the specified name.intgetCount()ITableStyle with the specified name.Use this method to retrieve a built-in or custom table style from the collection returned by Workbook.getTableStyles().
ITableStyle tableStyle = workbook.getTableStyles().get("TableStyleLight11");
worksheet.getTables().add(worksheet.getRange("A1:B3"), true).setTableStyle(tableStyle);
name - The name of the table style to retrieve.ITableStyle object with the specified name.ITableStyle at the specified index.This method retrieves a table style from the collection returned by Workbook.getTableStyles() using its zero-based position.
ITableStyleCollection tableStyles = workbook.getTableStyles();
tableStyles.add("CustomTableStyle");
ITableStyle tableStyle = tableStyles.get(tableStyles.getCount() - 1);
index - The zero-based index of the table style to retrieve.ITableStyle object at the specified index.IndexOutOfBoundsException - if index is less than 0 or greater than or equal to getCount().This count includes the table styles currently available in the workbook's ITableStyleCollection.
ITableStyleCollection tableStyles = workbook.getTableStyles();
tableStyles.add("CustomTableStyle");
int count = tableStyles.getCount();
Use this method to create an ITableStyle in the workbook table style collection returned by Workbook.getTableStyles().
ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
ITableStyleElement header = tableStyle.getTableStyleElements().get(TableStyleElementType.HeaderRow);
header.getInterior().setColor(Color.GetBlue());
name - The name of the table style to add. Must not be null.ITableStyle object.IllegalArgumentException - if name is null or a table style with the same name already exists.Use this method to check whether a built-in or custom table style is available in the collection returned by Workbook.getTableStyles().
ITableStyleCollection tableStyles = workbook.getTableStyles();
tableStyles.add("CustomStyle");
boolean hasCustomStyle = tableStyles.contains("CustomStyle");
name - The name of the table style to search for.