Copy link to clipboard
Copied
Is there an easy way to make sure the overall width of my tables are the same? I know how to do each cell, but that would be tedius to go check that for 42 pages of tables I've created. I was given this document, and the table widths on each page vary. I'd like them to be standard. But I am not seeing how to find the overall width of a table without adding up each width of each cell.
Thanks!
Julie
If the column widths are intended to be the same in all of the tables, you could use the script from this page to save the column widths from one table, and apply them to other tables that share the same Table Style.
It's not entirely automatic; you have to select each table and then apply the widths, but it is faster than manually checking and adjusting every cell in every table.
Copy link to clipboard
Copied
If the column widths are intended to be the same in all of the tables, you could use the script from this page to save the column widths from one table, and apply them to other tables that share the same Table Style.
It's not entirely automatic; you have to select each table and then apply the widths, but it is faster than manually checking and adjusting every cell in every table.
Copy link to clipboard
Copied
Thank you! I'll give it a try.
Copy link to clipboard
Copied
I finally had time to figure this out. And it worked perfectly. Thank you!
Copy link to clipboard
Copied
Hi Julie, Try this script, which asks you for a cell width and sets all of the table cells:
var x;
makeDialog();
function makeDialog(){
var d = app.dialogs.add({name:"Adjust Table Cells", canCancel:true});
with(d.dialogColumns.add()){
staticTexts.add({staticLabel:"Table Cell Widths:", staticAlignment:StaticAlignmentOptions.LEFT_ALIGN, minWidth: 150});
x = measurementEditboxes.add({editUnits:MeasurementUnits.INCHES, editValue:72, minWidth:90});
}
if(d.show() == true){
x = x.editValue;
adjustTable()
d.destroy();
}
}
function adjustTable(){
app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;
var t = app.documents[0].stories.everyItem().tables.everyItem().cells.everyItem().getElements()
if (t.length > 0) {
for (var i = 0; i < t.length; i++){
t[i].width = x
};
} else {
alert("Document has no tables")
}
app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;
}
After run:
Copy link to clipboard
Copied
Thanks! I'll try it!