[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

ITableStyleElements

Interface ITableStyleElements


public interface ITableStyleElements
表示表样式中的表样式元素集合。

此接口提供对各个 ITableStyleElement 对象的访问,这些对象定义表样式中特定部分的格式,例如整个表、标题行或汇总行。使用 ITableStyle.getTableStyleElements() 可以获取 ITableStyleElements 实例。


 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
    获取指定元素类型的表样式元素。
    int
    获取此集合中表样式元素的数量。
  • Method Details

    • getCount

      int getCount()
      获取此集合中表样式元素的数量。

      此方法返回当前 ITableStyleElements 集合中可用的 ITableStyleElement 对象数量。

      
       ITableStyle tableStyle = workbook.getTableStyles().add("CustomStyle");
       ITableStyleElements elements = tableStyle.getTableStyleElements();
       int count = elements.getCount();
       
      Returns:
      此集合中表样式元素的数量。此方法返回当前 ITableStyleElements 集合中可用的 ITableStyleElement 对象数量。
    • get

      获取指定元素类型的表样式元素。

      使用此方法可以访问定义表样式中特定部分格式的 ITableStyleElement,例如整个表或标题行。

      
       ITableStyle tableStyle = workbook.getTableStyles().add("CustomTableStyle");
       ITableStyleElement headerRow = tableStyle.getTableStyleElements().get(TableStyleElementType.HeaderRow);
       headerRow.getInterior().setColor(Color.GetBlue());
       
      Parameters:
      index - 要检索的表样式元素类型。
      Returns:
      指定元素类型的表样式元素。