Adding Column Spans

From Q
Jump to navigation Jump to search

Adds Spans (i.e., sub-headings) to the column of a table. Note that this does not change the underlying question (whereas if modifying a table by selecting headings, right-clicking and selecting Create Span the change would be made wherever the question in the rows is used).

// Span the Coke brands.
table.spanColumns([table.columnIndex('Coca Cola'),
                   table.columnIndex('Diet Coke'),
                   table.columnIndex('Coke Zero')],
                  'Coke Brands');

// Span the Pepsi brands.
table.spanColumns([table.columnIndex('Pepsi Light'),
                   table.columnIndex('Pepsi Max'),
                   table.columnIndex('Pepsi')],
                  'Pepsi Brands');

See also