Skip to main content
Known Participant
November 20, 2024
Question

is there a table style I can create where all columns and rows are the same size in a file

  • November 20, 2024
  • 1 reply
  • 301 views

is there a table style I can create where all columns and rows are the same size in a file

This topic has been closed for replies.

1 reply

Mike Witherell
Community Expert
Community Expert
November 20, 2024

Table menu > Distribute Rows Evenly and/or Distribute Columns Evenly

TableStyles and CellStyles do not have the ability to control absolute physical size.

Mike Witherell
FRIdNGE
November 20, 2024

But Javascript can simplistically imagine a gateway! … So 1 click!  😉

 

/*
    _FRIdNGE-0769_Width-HeightThroughTableStyle.jsx
    Script written by FRIdNGE, Michel Allio [20/11/24]
*/

var myDoc = app.activeDocument;
var myTables = myDoc.stories.everyItem().tables.everyItem().getElements();
var T = myTables.length,  t;
for ( t = 0; t < T; t++ ) {
    // "TableStyle_1" and "TableStyle_2" are Table Style Names:
    if ( myTables[t].appliedTableStyle.name === "TableStyle_1" ) {
        myTables[t].cells.everyItem().width = 8;
        myTables[t].cells.everyItem().height = 22;
    } else if ( myTables[t].appliedTableStyle.name === "TableStyle_2" ) {
        myTables[t].cells.everyItem().width = 16;
        myTables[t].cells.everyItem().height = 9;
    }
    // and so on! ...
}
alert( "Done! ...")

 

 

 

 

 

(^/)  The Jedi

Known Participant
November 20, 2024

I'm not sure how to install javascript into indesign