Copy link to clipboard
Copied
I am looking for an Indesign 2017 script that it will fit the table column with longest word in the column for multiple tables
any body can help me with that
Thanks
Copy link to clipboard
Copied
Hey you can try this,
var myDoc = app.documents[0];
var cellWidth = "";
var myTable = myDoc.pages[0].textFrames[0].tables[0];
for(var i = 0; i < myTable.cells.length; i++){
if(i == 0){
var l = myTable.cells.words.length;
}
else if(myTable.cells.words.length > l){
cellWidth = myTable.cells.width;
l = myTable.cells.words.length;
}
}
myTable.cells.everyItem().width = cellWidth;
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Yes....