TableTweaker Scripts
For a recent client project, page layout pro and InDesign scripting guru Dave Saunders wrote five separate Javascripts to help fit table elements to the text they contain. He generously posted a link to the scripts (I’ll add the link further down) on the Blueworld InDesign Talk mailing list for others to use, and I hope he doesn’t mind me writing about them here!
The bi-platform, InDesign CS2-only scripts are:
tableColWidthSqueezeL.jsx
tableColWidthSqueezeR.jsx
tableFitWidthToColumn.jsx
tableSetWidth.jsx
tableVerticalJustification.jsx
The two “Squeezers” transfer column width from the left-most to the right-most (and vice versa) column in a multi-column selection. “Fit Width” proportionally adjusts column widths so the table’s total width fits the width of the text frame (specifically, the width of the first column of the first text frame that holds the table) [edited]. “Set Width” proportionally adjusts existing column widths to match your desired table width. Finally, “Vertical Justification” adds space vertically to your table so it aligns perfectly with the bottom of the text area in all the text frames it occupies.
Download the .zip file of all five scripts, including an essential ReadMe that explains their usage and constraints, here. (Never installed or ran a script in InDesign? It’s easy — read our how-to.)
I’m sure we’ll be posting about other useful scripts available from Dave in the future. In the meantime you can browse for other ones (free and shareware) at his company website, PDS Associates. Dave also maintains a blog about JavaScripting InDesign at http://jsid.blogspot.com/.
Sidebar: I’ve known Dave for almost twenty years when we both were regulars on Compuserve’s Desktop Publishing Forum (armed with our trusty 300-baud modems). After I closed my Compuserve account in 1995 in favor of Netscape and the World Wide Web … heh … I lost touch with all the pros there. It’s pretty neat to see old friends reappear in the same path you’ve chosen. Actually, most of the regulars at the DTP forum can now be found on the web forum they created to replace it: http://desktoppublishingforum.com/.
Thanks Anne-Marie.
Your description of Fit Width is hard to follow. I hope you didn’t quote me verbatim from somewhere. What it does is fit the width of the table to be the same as that of the first column of the first text frame that contains the table.
Dave
Thanks for the correction, Dave! I think I’ve got it now (edited the post). Let me know if I’m still cornfused.
That’s right. Most of the time, of course, people don’t use tables in multicolumn text frames, but that is certainly not universally true, so I took care to accommodate multicolumn frames for this script. The result is a bit of a mouthful, though.
The Vertical Justification script would be much harder to write for multi-columns. It will work in certain cases but generally speaking it only works for single-column text frames. I wrote to to make a 12-page table I was working on look better across the spreads of the document.
Thanks,
Dave
No matter! Anything that makes tables less awkward is a blessing. I’m handicapped by the fact that I’m quite familiar with tables in Word, and some of the table stuff in InDesign works almost the same — same cursors, icons, etc. — but the rest doesn’t, and I find it be counterintuitive to the point of necromancy. Problem is, I never know which nec I need to romance. Or wring…