Table header row control

Bob.Conlin
Posts: 22

Table header row control

Sun Aug 14, 2011 5:50 am

Using the default DITA xml transformation to PDF I get tables ok but I need to change the style sheet (or something) for a couple of formatting issues.
1) How do I get rows not to break over page breaks?
2) How do I get table header row entries to render vertically?
3) How do I change the header row background color to change from yellow to Grey?
4) How do I get the header row to repeat on every page when a table breaks across pages? I'm going to be creating a lot of tables in my documents so this is very important.
I'm using Oxygen DITA files. I'm using the trial edition until the PO comes through. Thanks for the help.
Radu
Posts: 5585

Re: Table header row control

Mon Aug 15, 2011 5:31 pm

Hi Bob,

In order to publish DITA Maps to various output sources Oxygen uses the open source DITA Open Toolkit (DITA OT) which is bundled with each Oxygen installation in the folder:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT

Basically the DITA OT applies a variety of ANT build files and XSLT stylesheets to obtain an XSL-FO file from which, by applying a FO processor (like Apache FOP which is the default used in Oxygen) obtains the final PDF file.

There are a number of tutorials describing customizations for creating PDF using the DITA Open Toolkit like this one:
http://www.scriptorium.com/whitepapers/ditaotpdf/DITA-PDF-tweaks.pdf

The DITA Users List is also a good place to ask customization questions.

I will try to answer some of your questions below:

1) How do I get rows not to break over page breaks?

In the XSLT stylesheet:

Code: Select all

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/cfg/fo/attrs/tables-attr.xsl


there is an attribute set for table rows:

Code: Select all

 <xsl:attribute-set name="tbody.row">
        <!--Table body row-->
    </xsl:attribute-set>


which can be modified to add the following attribute to the generated FO file:

Code: Select all

 <xsl:attribute-set name="tbody.row">
        <!--Table body row-->
        <xsl:attribute name="keep-together.within-page">always</xsl:attribute>
    </xsl:attribute-set>


2) How do I get table header row entries to render vertically?


There is an attribute called reference-orientation in the XSL-FO specification which should control text rotation, but it probably implies more extensive changes in the stylesheets and it is possible that only the commercial FO processors (like XEP or Antenna House) support it. Maybe you should also ask around on the DITA Users List.

3) How do I change the header row background color to change from yellow to Grey?


If you open the following XSLT:

Code: Select all

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/demo/fo/cfg/fo/attrs/tables-attr.xsl


and search in it for "antiquewhite" you will see that some of these colors can be customized by changing values in the file.

4) How do I get the header row to repeat on every page when a table breaks across pages? I'm going to be creating a lot of tables in my documents so this is very important.


From what I've tested this is the default behavior. Maybe you can give me some screenshots, you can also contact us using the "support at oxygenxml dot com" email address.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Bob.Conlin
Posts: 22

Re: Table header row control

Sun Aug 21, 2011 7:56 am

Thanks, looks like that working for me.

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 0 guests