Copy link to clipboard
Copied
Hello,
How can I draw a table using scripts?
Note that my table may have spanned rows and/or columns!
Many thanks,
Aurel
@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
...Copy link to clipboard
Copied
@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
Copy link to clipboard
Copied
Many thanks!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now