Skip to main content
Inspiring
April 21, 2015
Answered

Losing table vertical alignment when converting ditamap to book

  • April 21, 2015
  • 2 replies
  • 877 views

FrameMaker Version: 12.0.4.445 (latest, part of TCS5)

  1. I have a structured project, where several XML files have been arranged into a ditamap.
  2. For one of the XML files, I have a table, where I need to set Cell Vertical Alignment of the cells to MIDDLE.
  3. So using Paragraph Designer > Table Cell, I change the entries from Top to Middle (The defaults were Top).
  4. With the ditamap pane selected, I then go File menu >> Save Ditamap As
  5. I save the ditamap as "Book 12.0 with fm components (*.book)" file type.
  6. In the resulting book, the XML files are now .FM files.

However, at this point, when I open the .FM file that has the table, the cell styles have reverted to TOP.

I've searched high-and-low for a similar issue. This is looking like a bug to me, but can someone confirm?

Thanks

This topic has been closed for replies.
Correct answer ScottPrentice

No .. this isn't a bug per-se. I'll bet that the alignment is lost before generating the book. After setting the alignment and saving/closing the file .. reopen it and see if the alignment is still there .. I'll bet it's gone. Typically, you can't apply formatting or properties to objects (elements) in a DITA file. This goes for font and paragraph properties as well as table formatting and other types of formatting. All you can do is create elements and set attributes. Any setting of properties will typically be lost on file save.

You'd likely need to have a "publishing process" (script of some kind) that you'd run on your generated book and chapter files which would scan for an attribute that would indicate certain properties need to be set on the table. The @outputclass attribute is typically used for this type of thing. I'm not aware of anything in default FrameMaker DITA that's set up to handle this type of formatting of tables.

If this formatting you're trying to apply is consistent for the entire table, it's possible that you'll be able to achieve this by creating a new table format that has this formatting set by default. When you insert a table in a topic, the table format is assigned to the tgroup/@outputclass attribute, and that's the formatting that is used when the table is rendered. Just create a new table format in the structured application template, and set up that format to have the properties you want. Then when you insert the table, be sure to select that format. It can be tricky to set this up but it *should* work.

However, if this doesn't work or you need more fine-grained formatting applied to table parts, I produce a tool called DITA-FMx that provides extended DITA authoring and publishing options for FrameMaker. It has features that allow this type of table formatting to be applied by setting the @outputclass attribute to a specific value on the row or cell. You can get more information on DITA-FMx here ..

     http://leximation.com/dita-fmx/

Good luck!

Scott Prentice

Leximation, Inc.

www.leximation.com

2 replies

Inspiring
April 24, 2015

(Perhaps the moderator should move this to the FrameMaker Integration discussion (under RoboHelp).

I've determined the correct settings for my purposes, that being vertical alignment in a FM-to-RH integration project. I originally thought it was specifically a FrameMaker issue, though the solution also involves settings in RoboHelp. Here are my findings:

1. For the selected FM table, note its Table Tag in the Table Designer (e.g., FormatA). This will be used later.

2. If there is table Entry > Image element, then select the Image element, and set its placement attribute = inline.

Though inline is supposed to be the default, I found it necessary to state explicitly in order to control alignment of image within a RH table cell.

3. Moving on from FM, in the CSS file that you are using with your RH project, suppose that you have defined your table as follows. Note that I'm using "CenterMiddle" as the title.

table.CenterMiddle {

  width: 100% ! important ;  /* This forces the RH table to autofit the window */

  text-align: Center;

  font-family: "Adobe Garamond Pro";

  border-left-style: Solid;

  border-left-width: 1px;

  border-left-color: #000000;

  border-right-style: Solid;

  border-right-width: 1px;

  border-right-color: #000000;

  border-top-style: Solid;

  border-top-width: 1px;

  border-top-color: #000000;

  border-bottom-style: Solid;

  border-bottom-width: 1px;

  border-bottom-color: #000000;

}

.CenterMiddle td {

  vertical-align: middle ! important ;  /* This forces the individual cells to align vertically */

  border-color: #000000;

  border-style: solid;

  border-width: 1px;

}

4. Go to the RH project to which the FM project is linked.

5. Go File menu > Project Settings.

6. In the FrameMaker Document group, click Edit.

7. Under FrameMaker Settings, locate the Table style that you noted in step (1), and set it to the name of your table from (3).

At this point, you can update all the FM components in your RH project, and compile the RH project to get the desired results. In my case, I needed both text and images in the table cells to have vertical alignment = middle.

Inspiring
April 21, 2015

Additional information.

This is all part of a FM-to-RH integration project, though the issue is specifically structured FrameMaker, as described.

After step (6), if I open the **FM** file that contains the table, I can change the Cell Vertical Alignment = middle, with no problem. I then get the correct formatting in the RH project.

The vertical alignment setting is getting cleared in step (5). What's odd is that the alignment setting gets reset to TOP in the original XML file, as well.

ScottPrentice
ScottPrenticeCorrect answer
Inspiring
April 21, 2015

No .. this isn't a bug per-se. I'll bet that the alignment is lost before generating the book. After setting the alignment and saving/closing the file .. reopen it and see if the alignment is still there .. I'll bet it's gone. Typically, you can't apply formatting or properties to objects (elements) in a DITA file. This goes for font and paragraph properties as well as table formatting and other types of formatting. All you can do is create elements and set attributes. Any setting of properties will typically be lost on file save.

You'd likely need to have a "publishing process" (script of some kind) that you'd run on your generated book and chapter files which would scan for an attribute that would indicate certain properties need to be set on the table. The @outputclass attribute is typically used for this type of thing. I'm not aware of anything in default FrameMaker DITA that's set up to handle this type of formatting of tables.

If this formatting you're trying to apply is consistent for the entire table, it's possible that you'll be able to achieve this by creating a new table format that has this formatting set by default. When you insert a table in a topic, the table format is assigned to the tgroup/@outputclass attribute, and that's the formatting that is used when the table is rendered. Just create a new table format in the structured application template, and set up that format to have the properties you want. Then when you insert the table, be sure to select that format. It can be tricky to set this up but it *should* work.

However, if this doesn't work or you need more fine-grained formatting applied to table parts, I produce a tool called DITA-FMx that provides extended DITA authoring and publishing options for FrameMaker. It has features that allow this type of table formatting to be applied by setting the @outputclass attribute to a specific value on the row or cell. You can get more information on DITA-FMx here ..

     http://leximation.com/dita-fmx/

Good luck!

Scott Prentice

Leximation, Inc.

www.leximation.com

Inspiring
April 22, 2015

Thanks Scott,

Yes, I can confirm that saving and reloading the XML file indicates that the Cell Vertical Alignment setting has been lost. That being the case, I'll create a new table format that has the default cell formatting that I need.