addColumn(column, [index])

Class: Table.

Description:

Adds a column to a Table as a last column or at specified index. An empty data will be added at that column index for each row.
For detail about column object format and all possible column properties refer to examples in the Table class description above.
See usage example below.

Parameters:

Name Type Description

column

string | number | TableColumn

A column Object with column properties, such as text, background color, etc.

[index]

number

Insert at this position. Index is the original position of columns that were before columns are reordered.

Returns:

Returns this Table for method chaining.

Type: Table

Examples:

Inserting a new column at an index 3:

table.addColumn({text: "Customer Name", header_align:"center"}, 3);

Also See: