[]
        
(Showing Draft Content)

ITableStyleElements

Interface ITableStyleElements


public interface ITableStyleElements
Represents the collection of table style elements in a table style.

This interface provides access to the individual ITableStyleElement objects that define formatting for specific parts of a table style, such as the whole table, header row, or total row. Use ITableStyle.getTableStyleElements() to obtain an ITableStyleElements instance.


 ITableStyle tableStyle = workbook.getTableStyles().add("CustomStyle");
 ITableStyleElements elements = tableStyle.getTableStyleElements();
 ITableStyleElement wholeTable = elements.get(TableStyleElementType.WholeTable);
 int count = elements.getCount();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the table style element for the specified element type.
    int
    Gets the number of table style elements in this collection.
  • Method Details

    • getCount

      int getCount()
      Gets the number of table style elements in this collection.

      This method returns the number of ITableStyleElement objects available through the current ITableStyleElements collection.

      
       ITableStyle tableStyle = workbook.getTableStyles().add("CustomStyle");
       ITableStyleElements elements = tableStyle.getTableStyleElements();
       int count = elements.getCount();
       
      Returns:
      The number of ITableStyleElement objects in this ITableStyleElements collection.
    • get

      Gets the table style element for the specified element type.

      Use this method to access the ITableStyleElement that defines formatting for a specific part of a table style, such as the whole table or the header row.

      
       ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
       ITableStyleElement headerRow = tableStyle.getTableStyleElements().get(TableStyleElementType.HeaderRow);
       headerRow.getInterior().setColor(Color.GetBlue());
       
      Parameters:
      index - The table style element type to retrieve.
      Returns:
      The ITableStyleElement object for the specified element type.