Adding Column Names to the Column Labels
		
		
		
		Jump to navigation
		Jump to search
		
Adds column names, A, B, C..., to the column headings.
var column_names = table.get('Column Names');// Get the column names
var column_labels = table.columnLabels;// Get the standard column labels.
for (var column = 0; column < table.numberColumns; column++) {// For each column...
   column_labels[column] = column_labels[column] + '\r\n' +   // '\r\n' is a special carriage-return code.
       column_names[0][column] + '\r\n';
}
table.columnLabels = column_labels;// Set the adjusted column labels.See also
- 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.