[]
A table style element defines the formatting applied to a specific part of a table, such as the whole table, header row, or striped rows. Use this interface to access the element's font, interior, borders, and stripe size settings.
ITableStyle style = workbook.getTableStyles().add("CustomStyle");
ITableStyleElement element = style.getTableStyleElements().get(TableStyleElementType.HeaderRow);
element.getFont().setBold(true);
element.getInterior().setColor(Color.GetBlue());
getFont()intvoidsetStripeSize(int value) Use the returned IBorders object to access or modify the border formatting applied to this table style element.
ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
ITableStyleElement element = tableStyle.getTableStyleElements().get(TableStyleElementType.HeaderRow);
IBorders borders = element.getBorders();
borders.get(BordersIndex.EdgeBottom).setLineStyle(BorderLineStyle.Thin);
The returned IInterior object represents the fill formatting of this table style element, such as its background color and pattern-related formatting.
ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
ITableStyleElement element = tableStyle.getTableStyleElements().get(TableStyleElementType.HeaderRow);
IInterior interior = element.getInterior();
interior.setColor(Color.GetBlue());
Use the returned IFont object to configure text formatting for the current table style element, such as bold, italic, or font color.
ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
ITableStyleElement element = tableStyle.getTableStyleElements().get(TableStyleElementType.HeaderRow);
IFont font = element.getFont();
font.setBold(true);
ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
ITableStyleElement element = tableStyle.getTableStyleElements().get(TableStyleElementType.FirstColumnStripe);
element.setStripeSize(2);
int stripeSize = element.getStripeSize();
Use this method on stripe-style table elements, such as TableStyleElementType.FirstRowStripe or TableStyleElementType.FirstColumnStripe, to define the stripe size.
ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
ITableStyleElement element = tableStyle.getTableStyleElements().get(TableStyleElementType.FirstColumnStripe);
element.setStripeSize(2);
value - The stripe size to apply to the table style element.