[]
        
(Showing Draft Content)

ITableStyleElement

Interface ITableStyleElement


public interface ITableStyleElement
Represents a single table style element.

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());
 
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the border formatting for this table style element.
    Gets the font formatting for this table style element.
    Gets the fill formatting for this table style element.
    int
    Gets the stripe size for this banded table style element.
    void
    setStripeSize(int value)
    Sets the stripe size for this banded table style element.
  • Method Details

    • getBorders

      IBorders getBorders()
      Gets the border formatting for this table style element.

      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);
       
      Returns:
      The border formatting for this table style element.
    • getInterior

      IInterior getInterior()
      Gets the fill formatting for this table style element.

      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());
       
      Returns:
      The fill formatting for this table style element.
    • getFont

      IFont getFont()
      Gets the font formatting for this table style element.

      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);
       
      Returns:
      The font formatting for this table style element.
    • getStripeSize

      int getStripeSize()
      Gets the stripe size for this banded table style element.
      
       ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
       ITableStyleElement element = tableStyle.getTableStyleElements().get(TableStyleElementType.FirstColumnStripe);
       element.setStripeSize(2);
       int stripeSize = element.getStripeSize();
       
      Returns:
      The stripe size for this banded table style element.
    • setStripeSize

      void setStripeSize(int value)
      Sets the stripe size for this banded table style element.

      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);
       
      Parameters:
      value - The stripe size to apply to the table style element.