• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Add table with designated number of rows and columns JS

People's Champ ,
May 09, 2010 May 09, 2010

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

TOPICS
Scripting

Views

738

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 09, 2010 May 09, 2010

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});

Votes

Translate

Translate
Community Expert ,
May 09, 2010 May 09, 2010

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});

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
May 10, 2010 May 10, 2010

Copy link to clipboard

Copied

LATEST

Thanks. I'll test it soon. Hopefully it will speed things up a little, and also shorten the undo queue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines