Copy link to clipboard
Copied
I have of 400 to 500 tables in indesign file, I have to set below properties for tables
and row width
is there any way to save such table properties and can be used to other tables or any script for the same...
thanks in advance...
Copy link to clipboard
Copied
yes you can do this easily.
define paragraph style with name "Paragraph Style 1" and character style using script or manually.
to apply this property in all table use
var doc = app.activeDocument;
var cellStyle = doc.cellStyles.add({name:"newCellStyle",appliedParagraphStyle : "Paragraph Style 1"})
doc.textFrames.everyItem().tables.everyItem().cells.everyItem().appliedCellStyle = cellStyle;
Copy link to clipboard
Copied
var doc = app.activeDocument;
var paraStyle = doc.paragraphStyles.add({name: "newParaStyle"});
with(paraStyle)
{
pointSize= 7;// for font size
justification = Justification.LEFT_ALIGN;
leftIndent = "0.5 mm";
rightIndent = "0.5 mm"
}
var cellStyle = doc.cellStyles.add({name:"newCellStyle",appliedParagraphStyle : paraStyle});
var tableStyle = doc.tableStyles.add({name: "newTableStyle"});
with(tableStyle)
{
bodyRegionCellStyle = cellStyle
headerRegionCellStyle = cellStyle
}
doc.textFrames.everyItem().tables.everyItem().appliedTableStyle = tableStyle;
doc.textFrames.everyItem().tables.everyItem().rows.everyItem().width = 50;//here you can specify your width
Copy link to clipboard
Copied
Thanks, it is working but i want to change cell properties and row hieght of tables also
font size 7 and leading 8
and cell properties
and row hieght
Thanks in advance!!!