Skip to main content
Known Participant
November 26, 2018
Answered

change cell inset

  • November 26, 2018
  • 1 reply
  • 1419 views

Hi, I have tables with different values ​​of bottoms cell inset. I would like to change the value of those who have 2mm for 3mm. I tried a few things but they change all the bottom cell insets. Thanks!

This topic has been closed for replies.
Correct answer FRIdNGE

well, I tried on a document with only one table, but when I'm in a larger file with a lot of tables it make a error.


// by FRIdNGE, november 2018

var myCells = app.activeDocument.stories.everyItem().tables.everyItem().cells.everyItem().getElements();

for (var c = 0; c < myCells.length; c++) if ( myCells.bottomInset == 2 ) myCells.bottomInset = 3;

Best,

Michel

1 reply

payalm68947498
Inspiring
November 27, 2018

Hi Marie,

    try this,

var myDoc = app.documents[0];

var table = myDoc.pages[0].textFrames[0].tables[0].cells;

for(var i = 0; i < table.length; i++){

    if(table.bottomInset == "2"){

        table.bottomInset = "3";

        }

    }

Known Participant
November 27, 2018

Awesome! Thank you so much

payalm68947498
Inspiring
November 27, 2018

Your welcome dear