Adding Row Spans
Jump to navigation
Jump to search
Adds Spans (i.e., sub-headings) to the rows 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.spanRows([table.rowIndex('Coca Cola'),
table.rowIndex('Diet Coke'),
table.rowIndex('Coke Zero')],
'Coke Brands');
// Span the Pepsi brands.
table.spanRows([table.rowIndex('Pepsi Light'),
table.rowIndex('Pepsi Max'),
table.rowIndex('Pepsi')],
'Pepsi Brands');
See also
- Adding Column Spans.
- Table JavaScript and Plot JavaScript for an explanation of how to run this code.
- Table JavaScript and Plot JavaScript Reference for technical information.
- Table JavaScript and Plot JavaScript Examples Library for other examples.
- JavaScript for information about the JavaScript programming language.
- QScript for tools for automating projects using JavaScript.
- JavaScript Variables for detail on how to create new variables in the Variables and Questions tab using JavaScript.