Skip to main content
Phil 815
Inspiring
October 5, 2023
Question

Adjust table column width without changing the overall table width

  • October 5, 2023
  • 4 replies
  • 1764 views

Hi all, 

I'm looking for a UXP solution to update a column width while keeping the same table width (i.e. all other columns adjust proportionatly to keep the table width the same). This would be the equivalent to shift+drag on a column edge within the InDesign GUI. Any help would be appreciated!

This topic has been closed for replies.

4 replies

TᴀW
Legend
October 9, 2023

When you say, "to update a column width," do you mean that you would like to adjust the column width to fit the contents of that column?

If so, have you seen my (not free): Table Tools for InDesign: AutoFit Columns - Id-Extras.com ?

 

id-extras.com | InDesign tools & scripts for typesetters, form designers, and translators
Peter Kahrel
Community Expert
Community Expert
October 9, 2023

No, there's nothing built-in, you have to do it yourself.

 

Peter Kahrel
Community Expert
Community Expert
October 7, 2023

You're mixing two things: Shift+drag a column edge resizes just the two columns to the left and the right of the selected edge. Shift+drag the table's right border resizes all columns proportionally.

 

To keep a table's width constant after resizing a column, divide the change value by the column count - 1, then resize all columns except the changed column.

 

I'm looking for a UXP solution

 

Does that mean you need more help to write a script that takes a value, resizes the selected column, and updates all other columns, or are you looking for someone to write the script for you?

Phil 815
Phil 815Author
Inspiring
October 9, 2023

Hi Peter, we have a solution but it requires a calculation to determine the width change of the column and then evenly distributing it across the other columns. I was just hoping there was an in-built option like a column width lock that would allow us to do it in a more elegant way, but it sounds like that's not the case. 

Willi Adelberger
Community Expert
Community Expert
October 6, 2023

While  moving the columns cell lines hold down the command/ctrl key. 

Phil 815
Phil 815Author
Inspiring
October 6, 2023

Hi WIlli, I'm looking for a scripting solution.