Adding Column Names to the Column Labels

From Q
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