Top Description Fields Methods
org.apache.poi.ss.usermodel

public Interface Table

Imports
java.util.regex.Pattern, org.apache.poi.ss.util.CellReference

XSSF Only! High level abstraction of table in a workbook.

Field Summary

Modifier and TypeField and Description
public static final Pattern
isStructuredReference

Regular expression matching a Structured Reference (Table syntax) for XSSF table expressions.

Method Summary

Modifier and TypeMethod and Description
public default boolean

Returns:

true if the table and cell are on the same sheet and the cell is within the table range.
contains
(Cell cell)

checks if the given cell is part of the table.

public boolean

Returns:

true if the table and cell are on the same sheet and the cell is within the table range.
contains
(CellReference
reference to a possibly undefined cell location
cell
)

checks if the given cell is part of the table.

public int

Returns:

column index corresponding to columnHeader
findColumnIndex
(String
the column header name to get the table column index of
columnHeader
)

Returns the index of a given named column in the table (names are case insensitive in XSSF).

public int

Returns:

table end column index on sheet
getEndColIndex
()

Get the bottom-right column index on the sheet

public int

Returns:

table end row index on sheet
getEndRowIndex
()

Get the bottom-right row index

public int

Returns:

0 for no header rows, 1 for table headers shown. Values > 1 might be used by Excel for pivot tables?
getHeaderRowCount
()

public String

Returns:

table name
getName
()

Get the name of the table.

public String

Returns:

sheet name
getSheetName
()

Returns the sheet name that the table belongs to.

public int

Returns:

table start column index on sheet
getStartColIndex
()

Get the top-left column index relative to the sheet

public int

Returns:

table start row index on sheet
getStartRowIndex
()

Get the top-left row index on the sheet

public TableStyleInfo

Returns:

TableStyleInfo for this instance
getStyle
()

public String

Returns:

name of the table style, if there is one. May be a built-in name or user-defined.
getStyleName
()

public int

Returns:

0 for no totals rows, 1 for totals row shown. Values > 1 are not currently used by Excel up through 2016, and the OOXML spec doesn't define how they would be implemented.
getTotalsRowCount
()

public boolean

Returns:

true if a totals row has ever been shown for this table
isHasTotalsRow
()

Note

This is misleading.

Field Detail

isStructuredReferenceback to summary
public static final Pattern isStructuredReference

Regular expression matching a Structured Reference (Table syntax) for XSSF table expressions. Public for unit tests

See Also
Excel Structured Reference Syntax

Method Detail

containsback to summary
public default boolean contains(Cell cell)

checks if the given cell is part of the table. Includes checking that they are on the same sheet.

Returns:boolean

true if the table and cell are on the same sheet and the cell is within the table range.

Since
3.17 beta 1
See Also
(prefered, faster execution and handles undefined cells)
containsback to summary
public boolean contains(CellReference cell)

checks if the given cell is part of the table. Includes checking that they are on the same sheet.

Parameters
cell:CellReference

reference to a possibly undefined cell location

Returns:boolean

true if the table and cell are on the same sheet and the cell is within the table range.

Since
3.17 beta 1
findColumnIndexback to summary
public int findColumnIndex(String columnHeader)

Returns the index of a given named column in the table (names are case insensitive in XSSF). Note this list is lazily loaded and cached for performance. Changes to the underlying table structure are not reflected in later calls unless XSSFTable.updateHeaders() is called to reset the cache.

Parameters
columnHeader:String

the column header name to get the table column index of

Returns:int

column index corresponding to columnHeader

getEndColIndexback to summary
public int getEndColIndex()

Get the bottom-right column index on the sheet

Returns:int

table end column index on sheet

getEndRowIndexback to summary
public int getEndRowIndex()

Get the bottom-right row index

Returns:int

table end row index on sheet

getHeaderRowCountback to summary
public int getHeaderRowCount()
Returns:int

0 for no header rows, 1 for table headers shown. Values > 1 might be used by Excel for pivot tables?

Since
3.17 beta 1
getNameback to summary
public String getName()

Get the name of the table.

Returns:String

table name

getSheetNameback to summary
public String getSheetName()

Returns the sheet name that the table belongs to.

Returns:String

sheet name

getStartColIndexback to summary
public int getStartColIndex()

Get the top-left column index relative to the sheet

Returns:int

table start column index on sheet

getStartRowIndexback to summary
public int getStartRowIndex()

Get the top-left row index on the sheet

Returns:int

table start row index on sheet

getStyleback to summary
public TableStyleInfo getStyle()
Returns:TableStyleInfo

TableStyleInfo for this instance

Since
3.17 beta 1
getStyleNameback to summary
public String getStyleName()
Returns:String

name of the table style, if there is one. May be a built-in name or user-defined.

Since
3.17 beta 1
getTotalsRowCountback to summary
public int getTotalsRowCount()
Returns:int

0 for no totals rows, 1 for totals row shown. Values > 1 are not currently used by Excel up through 2016, and the OOXML spec doesn't define how they would be implemented.

Since
3.17 beta 1
isHasTotalsRowback to summary
public boolean isHasTotalsRow()

Note

This is misleading. The OOXML spec indicates this is true if the totals row has ever been shown, not whether or not it is currently displayed. Use getTotalsRowCount() > 0 to decide whether or not the totals row is visible.

Returns:boolean

true if a totals row has ever been shown for this table

Since
3.15 beta 2
See Also
getTotalsRowCount()