Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change column width of multiple tables

New Here ,
Nov 12, 2019 Nov 12, 2019

I hope there is a simple answer to this, but is there a script that anyone has developed for incorporating a set column width into a table style?  If not, is there a script for setting one column width for every column in an InDesign document?

 

Thank you so much in advance.

TOPICS
How to , Scripting
619
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 12, 2019 Nov 12, 2019

This may not be exactly what you are looking for, but it does format a table to defined widths.

I got this script many years ago and unfortunately I am unable to determine where I got it from or who wrote it, so apologies to the author.

It works for me as I need to format a whole bunch of tables to the same column widths within a document. Just change the values for the widths (in the second line of the script) and save it. Then select your table and apply.

var myDoc = app.activeDocument;

var myWidths = [96, 19, 19, 19];

for(var T=0; T < myDoc.textFrames.length; T++){

for(var i=0; i < myDoc.textFrames[T].tables.length; i++){

for(var j=0; j < myWidths.length; j++){

myDoc.textFrames[T].tables[i].columns[j].width = myWidths[j];

}

}

}

alert("Table width updated successfully...");

 

I hope this helps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 13, 2019 Nov 13, 2019
LATEST

Hi abbyb26,

yes, I think someone did, some years ago.

Gerald Singelmann's AutoSpalte script.

 

From his website in German:

https://www.cuppascript.com/tabellenspalten-numerisch-setzen/

 

Regards,
Uwe Laubender

( ACP )

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines