A proposal for markup to specify the orientation of tables and the contents of table cells.
|
|
Date and version information |
Include the following information:
|
• |
Feature proposal completed June 26, 2012 |
|
• |
Champion by Chris Nitchie |
|
• |
Phase 1 approval on October 11, 2011 (minutes missing) |
|
|
Original requirement or use case |
Consider adding the @rotate attribute from the CALS table model to the version of the OASIS Exchange table model used in DITA
topics.
10/11: @rotate applies only to entry element. Will also try to pick up @orient at the table level. Will require careful wording
related to style (landscape table in middle of 2-col, or in HTML, etc).
Vertical Column Headers. A table containing numerical data whose column headers should be oriented vertically to avoid taking up too much horizontal
space.
Grouped Rows. A user wishes to group a series of rows according to a single spanning cell at the beginning of the row. To avoid that cell
taking up too much space, the user wants to orient the text in that cell vertically.
Wide Tables. A table is expected to be wider than can be comfortably accommodated by an upright page, so needs to be printed with a landscape
orientation.
Incorporate the CALS attributes for supporting these behaviors into the DITA table model, specifically orient on table and rotate on entry.
This feature will benefit users of complex tables who need greater control over the way the tabular data is presented. A solution
could be built using custom stylesheets with the outputclass attribute, but such solutions would not be as portable as having these attributes built into the standard.
DTD and Schema modifications |
Topic or map specialization |
These changes will go into the tblDecl.mod DTD module and tblDeclMod.xsd schema.
|
Domain |
No new domain. |
Element |
No new elements. |
Attributes |
|
• |
orient
|
– |
Specifies the orientation of the resulting table in printed outputs, or outputs that emulate printed output, such as PDF.
A value of "port" is “upright”, the same orientation as the rest of the text flow. An orientation of "land" causes the table to be rotated 90° counter–clockwise from the upright orientation. In situations where a stylesheet or other
formatting mechanism specifies table orientation based on other criteria, or for non-paginated outputs, the orient attribute may be ignored.
|
|
|
• |
rotate
|
– |
Users can specify any value other than "0" for the rotate attribute to cause the contents of the table cell to be rotated 90° counter-clockwise.
|
|
|
|
Processing impact |
|
• |
Print engines will need to be able to orient cells and tables properly. |
|
• |
These changes will not interact with existing DITA features. |
|
Spec update costs will be minimal. The topics in the language reference covering the entry and table elements will need to list the appropriate new attribute. The DTD/Schema updates will be trivial.
Tools that generate paginated output will need to be able to handle the orientation of tables and text within table cells.
XSL-FO stylesheets will need to be updated to process these attributes and generate the appropriate markup to rotate tables
and cell contents, e.g. <fo:block-container reference-orientation="-90">. Other print engines will have their own mechanisms for implementing text rotation. Any print engine that supports these
attributes in the CALS table model should be able to easily support these changes.
The following markup creates a narrow table with vertical columns in the header and in multi-row cells in the first column,
and specifies (for no particular reason) that it be printed in landscape orientation.
<table orient="land">
<title>Vertical Cells Example</title>
<tgroup cols="3">
<colspec colname="col1" colwidth="22.00pt"/>
<colspec colname="col2" colwidth="22.00pt"/>
<colspec colname="col3" colwidth="22.00pt"/>
<thead>
<row>
<entry valign="top"></entry>
<entry rotate="1" valign="top">Width</entry>
<entry rotate="1" valign="top">Height</entry>
</row>
</thead>
<tbody>
<row>
<entry morerows="1" rotate="1">Small</entry>
<entry>2</entry>
<entry>4</entry>
</row>
<row>
<entry>3</entry>
<entry>6</entry>
</row>
<row>
<entry morerows="2" rotate="1">Medium</entry>
<entry>6</entry>
<entry>12</entry>
</row>
<row>
<entry>8</entry>
<entry>16</entry>
</row>
<row>
<entry>10</entry>
<entry>20</entry>
</row>
<row>
<entry morerows="1" rotate="1">Large</entry>
<entry>12</entry>
<entry>24</entry>
</row>
<row>
<entry>15</entry>
<entry>30</entry>
</row>
</tbody>
</tgroup>
</table>