Highlighted

How does one change a tables title to something meaningful

Community Beginner ,
Jul 23, 2019

Copy link to clipboard

Copied

Tables come up with a title of "Table 1:", how do I change that to be more meaningful like "Sale Projections by Region"?

  //Create the table

   var textLoc, tbl; 

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

    // NewTable(format, numCols, numBodyRows, numHeaderRows, numFooterRows, textLoc)

    tbl = doc.NewTable ("Format A", 4, 10, 1, 0, textLoc);

  //Change the table title from "Table 1:" to "Sale Projections by Region"

???

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

The table title is like any other FrameMaker paragraph: it has a Paragraph Format applied to it. Typically, you would redefine the autonumber properties for the table's title paragraph format so that it matches what you want. In your case, you may just want to remove the autonumber and then add the correct text depending on the table's contents. For a table containing the cursor, here is how you add text to the table title.

#target framemaker

var doc, tbl, textLoc, pgf;

doc = app.ActiveDoc;

tbl = doc.SelectedTbl;

// Get the table's title paragraph.

pgf = tbl.FirstPgf;

// Make a TextLoc and add the desired title.

textLoc = new TextLoc (pgf, 0);

doc.AddText (textLoc, "Sale Projections by Region");

TOPICS
Scripting

Views

106

Likes

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

How does one change a tables title to something meaningful

Community Beginner ,
Jul 23, 2019

Copy link to clipboard

Copied

Tables come up with a title of "Table 1:", how do I change that to be more meaningful like "Sale Projections by Region"?

  //Create the table

   var textLoc, tbl; 

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

    // NewTable(format, numCols, numBodyRows, numHeaderRows, numFooterRows, textLoc)

    tbl = doc.NewTable ("Format A", 4, 10, 1, 0, textLoc);

  //Change the table title from "Table 1:" to "Sale Projections by Region"

???

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

The table title is like any other FrameMaker paragraph: it has a Paragraph Format applied to it. Typically, you would redefine the autonumber properties for the table's title paragraph format so that it matches what you want. In your case, you may just want to remove the autonumber and then add the correct text depending on the table's contents. For a table containing the cursor, here is how you add text to the table title.

#target framemaker

var doc, tbl, textLoc, pgf;

doc = app.ActiveDoc;

tbl = doc.SelectedTbl;

// Get the table's title paragraph.

pgf = tbl.FirstPgf;

// Make a TextLoc and add the desired title.

textLoc = new TextLoc (pgf, 0);

doc.AddText (textLoc, "Sale Projections by Region");

TOPICS
Scripting

Views

107

Likes

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
Jul 23, 2019 0
Adobe Community Professional ,
Jul 23, 2019

Copy link to clipboard

Copied

The table title is like any other FrameMaker paragraph: it has a Paragraph Format applied to it. Typically, you would redefine the autonumber properties for the table's title paragraph format so that it matches what you want. In your case, you may just want to remove the autonumber and then add the correct text depending on the table's contents. For a table containing the cursor, here is how you add text to the table title.

#target framemaker

var doc, tbl, textLoc, pgf;

doc = app.ActiveDoc;

tbl = doc.SelectedTbl;

// Get the table's title paragraph.

pgf = tbl.FirstPgf;

// Make a TextLoc and add the desired title.

textLoc = new TextLoc (pgf, 0);

doc.AddText (textLoc, "Sale Projections by Region");

Likes

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
Reply
Loading...
Jul 23, 2019 0
Adobe Community Professional ,
Jul 23, 2019

Copy link to clipboard

Copied

Gene, if you are satisfied with my answers, please mark them as Correct. I answered some of your other questions, but you did not mark them as Correct. I would appreciate if you would. Thank you.

Likes

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
Reply
Loading...
Jul 23, 2019 0
Adobe Community Professional ,
Jul 23, 2019

Copy link to clipboard

Copied

I am sorry about that. You marked it correct as I was posting my request. Thank you very much!

Likes

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
Reply
Loading...
Jul 23, 2019 0