Thanks to the OP/Theunis and Roland for their posts here.
I have a 100 page document that I imported from Word. On each page is a table. Unfortunately all 100 of these tables stick out over the margin and off the page. Thanks to the javascript form Theunis, I managed to fix this issue! So FYI for beginners who don’t know how to use Scripts in InDesign:
1. In Dreamweaver, create a new Javascript file.
2. Paste the code*:
app.activeDocument.stories.everyItem().tables.everyItem().columns[0].width = ‘17.956mm’;
3. Save this Javascript file and name it whatever you want, but you must save it in the ‘Program Files’ > ‘Adobe’ > ‘Adobe InDesign C 2015’ > ‘Script’s > ‘Scripts Panel’**
4. Now go to InDesign and open your document with your tables in it
5. Open up the ‘Scripts’ panel. If you don’t have it, it’s under ‘Window’ > ‘Utilities’ > ‘Scripts’.
6. Now all you have to do is double click on the Javascript file you saved in point 3!
* Let me explain the code a bit. For each column table, repeat this exact line, but change the number. So for example, I have a whole lot of 6 columned tables. So my Javascript file looks like:
app.activeDocument.stories.everyItem().tables.everyItem().columns[0].width = ‘17.956mm’;
app.activeDocument.stories.everyItem().tables.everyItem().columns[1].width = ‘17.956mm’;
app.activeDocument.stories.everyItem().tables.everyItem().columns[2].width = ‘17.956mm’;
app.activeDocument.stories.everyItem().tables.everyItem().columns[3].width = ‘17.956mm’;
app.activeDocument.stories.everyItem().tables.everyItem().columns[4].width = ‘17.956mm’;
app.activeDocument.stories.everyItem().tables.everyItem().columns[5].width = ‘17.956mm’;
** I’m on a PC with CC 2015 – so apologies for not providing an example for Macs if it’s different. I’m not on my Mac at the mo.