Copy link to clipboard
Copied
Hello,
Simple question: What is the syntax for adding a table with a specified number of rows and columns? I'm not getting it. (I know how to add them later, but I want to do it when I create the table). Here's the entry in the ESTK:
Tables.add (to: LocationOptions , reference:any, withProperties: Object 😞 Table
Creates a new table.
to (optional): Data Type: LocationOptions , Default Value: LocationOptions.UNKNOWN
The location of the new table relative to the reference object or within the container object. (Optional)
reference: Data Type: any
The reference object. Note: Required when the to value specifies before or after. Can accept: Table, XmlStory, XMLElement, TextFrame, Text, Character, Word, Line, Paragraph, TextColumn, InsertionPoint, Story, Cell or TextStyleRange. (Optional)
withProperties: Data Type: Object
Initial values for properties of the new Table (Optional)
Thank you,
Ariel
After bit of experimenting, I found this to work:
t = app.selection[0].tables.add(LocationOptions.AT_BEGINNING, undefined, {columnCount:2, headerRowCount:1, bodyRowCount:5, footerRowCount:3});
Copy link to clipboard
Copied
After bit of experimenting, I found this to work:
t = app.selection[0].tables.add(LocationOptions.AT_BEGINNING, undefined, {columnCount:2, headerRowCount:1, bodyRowCount:5, footerRowCount:3});
Copy link to clipboard
Copied
Thanks. I'll test it soon. Hopefully it will speed things up a little, and also shorten the undo queue.