ListObjectCollection

ListObjectCollection class

Represents a collection of ListObject objects in the worksheet.

class ListObjectCollection implements Iterable<ListObject>;

Methods

MethodDescription
get(number)Gets the ListObject by index.
get(string)Gets the ListObject by specified name.
add(number, number, number, number, boolean)Adds a ListObject to the worksheet.
add(string, string, boolean)Adds a ListObject to the worksheet.
removeAt(number)Remove ListObject by index.
updateColumnName()Update all column name of the tables.
getCount()@deprecated. Please use the ‘count’ property instead. Gets the number of elements contained in.
isNull()Checks whether the implementation object is null.

[Symbol.iterator](): Iterator<ListObject>

Returns an iterator over the items in the collection. Enables use of for...of, spread syntax, and Array.from().

get(number)

Gets the ListObject by index.

get(index: number) : ListObject;

Parameters:

ParameterTypeDescription
indexnumberThe index.

Returns

The ListObject

get(string)

Gets the ListObject by specified name.

get(tableName: string) : ListObject;

Parameters:

ParameterTypeDescription
tableNamestringListObject name.

Returns

The ListObject

add(number, number, number, number, boolean)

Adds a ListObject to the worksheet.

add(startRow: number, startColumn: number, endRow: number, endColumn: number, hasHeaders: boolean) : number;

Parameters:

ParameterTypeDescription
startRownumberThe start row of the list range.
startColumnnumberThe start row of the list range.
endRownumberThe start row of the list range.
endColumnnumberThe start row of the list range.
hasHeadersbooleanWhether the range has headers.

Returns

The index of the new ListObject

add(string, string, boolean)

Adds a ListObject to the worksheet.

add(startCell: string, endCell: string, hasHeaders: boolean) : number;

Parameters:

ParameterTypeDescription
startCellstringThe start cell of the list range.
endCellstringThe end cell of the list range.
hasHeadersbooleanWhether the range has headers.

Returns

The index of the new ListObject

removeAt(number)

Remove ListObject by index.

removeAt(index: number) : void;

Parameters:

ParameterTypeDescription
indexnumberThe index.

updateColumnName()

Update all column name of the tables.

updateColumnName() : void;

getCount()

@deprecated. Please use the ‘count’ property instead. Gets the number of elements contained in.

getCount() : number;

isNull()

Checks whether the implementation object is null.

isNull() : boolean;