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

How does one change a tables title to something meaningful

Community Beginner ,
Jul 23, 2019 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"

???

TOPICS
Scripting

Views

259

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 , Jul 23, 2019 Jul 23, 2019

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 = do

...

Votes

Translate

Translate
Community Expert ,
Jul 23, 2019 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");

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
Community Expert ,
Jul 23, 2019 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.

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
Community Expert ,
Jul 23, 2019 Jul 23, 2019

Copy link to clipboard

Copied

LATEST

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

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