Skip to main content
Gene Sorg
Participant
July 17, 2019
Answered

Newbie Question #2: Creating Tables

  • July 17, 2019
  • 1 reply
  • 307 views

How do I add a 5 row x 3 column table with headers to a document? I have written a little jsx from existing documents but am having issues understanding how to create new objects.

This topic has been closed for replies.
Correct answer frameexpert

#target framemaker

var doc, textLoc, tbl;

doc = app.ActiveDoc;

textLoc = new TextLoc (doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf, 0);

tbl = doc.NewTable ("Format A", 3, 5, 1, 0, textLoc);

Note that if the table format specified in the first parameter of NewTable doesn't exist in the document, the table will not be created.

1 reply

frameexpert
Community Expert
frameexpertCommunity ExpertCorrect answer
Community Expert
July 17, 2019

#target framemaker

var doc, textLoc, tbl;

doc = app.ActiveDoc;

textLoc = new TextLoc (doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf, 0);

tbl = doc.NewTable ("Format A", 3, 5, 1, 0, textLoc);

Note that if the table format specified in the first parameter of NewTable doesn't exist in the document, the table will not be created.

www.frameexpert.com