How to make a script for expand column width
Hi experts,
Is that possible to make a script for expand the column width aim to let the columns show up all the overset text?
Regard
John
Hi experts,
Is that possible to make a script for expand the column width aim to let the columns show up all the overset text?
Regard
John
Hi John,
Sorry about that, try this, it'll count through all the tables in your document.
myTables = app.documents[0].stories.everyItem().tables.everyItem().getElements();
for (var t = 0; t < myTables.length; t++) {
BE_resizeColumnsToFitContents(myTables
); }
function BE_resizeColumnsToFitContents(tableToEdit) {
for (var i = 0; i < tableToEdit.columns.length; i++) {
while (tableToEdit.columns.overflows === true) {
tableToEdit.columns.width += 1;
tableToEdit.columns.recompose();
}
}
}
Brett
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.