0
May i resize table, which right edge standing out of page/frame border
New Here
,
/t5/indesign-discussions/may-i-resize-table-which-right-edge-standing-out-of-page-frame-border/td-p/1150091
Apr 15, 2008
Apr 15, 2008
Copy link to clipboard
Copied
After pasting big table, its right edge is commonly outside of story frame. To resize the table we use cursor+shift key and slide right border to adjust a frame edge. Can we do it by script?
b Thanks.
b Thanks.
TOPICS
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/indesign-discussions/may-i-resize-table-which-right-edge-standing-out-of-page-frame-border/m-p/1150092#M278078
Apr 15, 2008
Apr 15, 2008
Copy link to clipboard
Copied
Place the cursor somewhere in the table to be resized and run the following script. It checks only if the cursor is in a table, nothing else -- it's very basic.
Peter
#target indesign
sel = app.selection[0];
if ( (sel.constructor.name != 'InsertionPoint')
&& sel.parent.constructor.name != 'Cell')
exit();
fw = framewidth (sel);
col = sel.parent.parent.columns;
col.everyItem().width = fw / col.length;
function framewidth (s)
{
var gb = s.parentTextFrames[0].geometricBounds
return gb[3]-gb[1]
}
Peter
#target indesign
sel = app.selection[0];
if ( (sel.constructor.name != 'InsertionPoint')
&& sel.parent.constructor.name != 'Cell')
exit();
fw = framewidth (sel);
col = sel.parent.parent.columns;
col.everyItem().width = fw / col.length;
function framewidth (s)
{
var gb = s.parentTextFrames[0].geometricBounds
return gb[3]-gb[1]
}
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
_Dmitry1776_
AUTHOR
New Here
,
/t5/indesign-discussions/may-i-resize-table-which-right-edge-standing-out-of-page-frame-border/m-p/1150093#M278079
Apr 16, 2008
Apr 16, 2008
Copy link to clipboard
Copied
Thanks. I use VBS, so here is what i got (with help of your code):
b Set MyInd = CreateObject("InDesign.Application.CS3")
b Set myTable = MyInd.Selection.Item(1).Parent.Parent 'recognize table
b gb = myTable.Parent.GeometricBounds 'width of page
b framewidth = gb(3) - gb(1)
b myTable.Width = framewidth
Now i'll think about proportional changing width of each column.
b Set MyInd = CreateObject("InDesign.Application.CS3")
b Set myTable = MyInd.Selection.Item(1).Parent.Parent 'recognize table
b gb = myTable.Parent.GeometricBounds 'width of page
b framewidth = gb(3) - gb(1)
b myTable.Width = framewidth
Now i'll think about proportional changing width of each column.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/indesign-discussions/may-i-resize-table-which-right-edge-standing-out-of-page-frame-border/m-p/1150094#M278080
Apr 16, 2008
Apr 16, 2008
Copy link to clipboard
Copied
Ah, yes, VB doesn't have everyItem(0. In that case you should set each column individually:
colwidth = fw / col.length
for (i = 0; i < col.length; i++)
col.width = colwidth;
Peter
colwidth = fw / col.length
for (i = 0; i < col.length; i++)
col.width = colwidth;
Peter
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

