Change column width in multiple tables
- This topic has 2 replies, 2 voices, and was last updated 6 years, 3 months ago by .
- You must be logged in to reply to this topic.
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Change column width in multiple tables
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Change column width in multiple tables
I have a few hundred tables in an Indesign document where I need the first column to be 8p6 wide and the 2nd column to be 35p. Each table has a header row the width of the full column, so the columns actually start on the 2nd row. Does anyone have a script for that? Help!
It’s okay, I found something. But your document preferences has to have the units set to “points”.
// Number of columns in a table may vary depends on the book.
// If the columns count is constant then you can use the below script.
var myDoc = app.activeDocument;
var myWidths = [102, 420];
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];
}
}
}
Not sure if these will help, but:
https://creativepro.com/sizing-tables-with-script.php
and
https://creativepro.com/tackling-tables-through-scripting.php
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!