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

table draw!

New Here ,
Nov 24, 2011 Nov 24, 2011

Hello,

How can I draw a table using scripts?

Note that my table may have spanned rows and/or columns!

Many thanks,

Aurel

TOPICS
Scripting
617
Translate
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 , Nov 24, 2011 Nov 24, 2011

@Aurel:
JavaScript: basically by adding a table object to an insertionPoint of a text frame or a story.

If you have selected an empty text frame:

var myTable = app.selection[0].insertionPoints[0].tables.add();

Then add columns (4) and rows (10) to the table:

myTable.columnCount = 4; //Limit: 200
myTable.bodyRowCount = 10 //Limit: 10.000 ???

This table will span the whole text frame, all four columns evenly devided.

For more properties and methods for text frames, insertionPoints, tables, columns, rows a

...
Translate
Community Expert ,
Nov 24, 2011 Nov 24, 2011

@Aurel:
JavaScript: basically by adding a table object to an insertionPoint of a text frame or a story.

If you have selected an empty text frame:

var myTable = app.selection[0].insertionPoints[0].tables.add();

Then add columns (4) and rows (10) to the table:

myTable.columnCount = 4; //Limit: 200
myTable.bodyRowCount = 10 //Limit: 10.000 ???

This table will span the whole text frame, all four columns evenly devided.

For more properties and methods for text frames, insertionPoints, tables, columns, rows and cells see Jongware's excellent documentation of the DOM:

http://www.jongware.com/idjshelp.html

Uwe

Translate
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
New Here ,
Nov 25, 2011 Nov 25, 2011
LATEST

Many thanks!

Translate
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