Reply To: Table Frustrations

#90812

Nick, select your whole table and try this one:

app.doScript(main, ScriptLanguage.JAVASCRIPT , [], UndoModes.ENTIRE_SCRIPT, "column width");

function main() {

var colValues = [10, 20, 30, 40, 50, 60, 70]; // insert here your values !

if (!app.selection.length || app.selection[0].constructor.name != "Table") {
  alert("wrong selection");
  return;
}

var allColumns = app.selection[0].columns;
var nCols = allColumns.length;

if (colValues.length != nCols) {
  alert("check your 'colValues' list");
  return;
}

for (var i = 0; i < nCols; i++) {
  var curCol = allColumns[i];
  curCol.width = colValues[i];
}
}

This article was last modified on December 28, 2016

Comments (0)

Loading comments...