0% found this document useful (0 votes)
13 views3 pages

Table Commands

The document outlines the structure and syntax for defining tables in RTF, emphasizing that tables are created using paragraph properties rather than a specific table group. It details the control words used for table rows, cells, formatting, borders, and shading, as well as the rules for positioning and alignment. An example of RTF table text is provided to illustrate the application of these definitions.

Uploaded by

Fábio Luna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Table Commands

The document outlines the structure and syntax for defining tables in RTF, emphasizing that tables are created using paragraph properties rather than a specific table group. It details the control words used for table rows, cells, formatting, borders, and shading, as well as the rules for positioning and alignment. An example of RTF table text is provided to illustrate the application of these definitions.

Uploaded by

Fábio Luna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Table Definitions

There is no RTF table group; instead, tables are specified as paragraph properties. A table is represented as a
sequence of table rows. A table row is a continuous sequence of paragraphs partitioned into cells. The table
row begins with the \trowd control word and ends with the \row control word. Every paragraph that is
contained in a table row must have the \intbl control word specified or inherited from the previous
paragraph. A cell may have more than one paragraph in it; the cell is terminated by a cell mark (the \cell
control word), and the row is terminated by a row mark (the \row control word). Table rows can also be
positioned. In this case, every paragraph in a table row must have the same positioning controls (see the
<apoctl> controls on page 29 of this Application Note). Table properties may be inherited from the previous
row; therefore, a series of table rows may be introduced by a single <tbldef>.

An RTF table row has the following syntax, as shown in the general paragraph-text syntax shown on page
23 of this Application Note.

<row> <tbldef> <cell>+ \row


<cell> <textpar>+ \cell

A table definition has the following syntax:

<tbldef> \trowd \trgaph <rowjust>? & <rowwrite>? <rowtop>? & <rowbot>? & <rowleft>? &
<rowright>? & <rowhor>? & <rowvert>? & \trleft? & \trrh? \trhdr? & \trkeep? <celldef>+
<rowjust> \trql | \trqr | \trqc
<rowwrite> \ltrrow | \rtlrow
<rowtop> \trbrdrt <brdr>
<rowbot> \trbrdrl <brdr>
<rowleft> \trbrdrb <brdr>
<rowright> \trbrdrr <brdr>
<rowhor> \trbrdrh <brdr>
<rowvert> \trbrdrv <brdr>
<celldef> (\clmgf? & \clmrg? <celltop>? & <cellleft>? & <cellbot>? & <cellright>? & <cellshad>?) \
cellx
<celltop> \clbrdrt <brdr>
<cellleft> \clbrdrl <brdr>
<cellbot> \clbrdrb <brdr>
<cellright> \clbrdrr <brdr>
<cellshad> <cellpat>? \clcfpat? & \clcbpat? & \clshdng
<cellpat> \clbghoriz | \clbgvert | \clbgfdiag | \clbgbdiag | \clbgcross | \clbgdcross | \clbgdkhor | \
clbgdkvert | \clbgdkfdiag | \clbgdkbdiag | \clbgdkcross | \clbgdkdcross

Note for <tbldef> that the number of \cellxs must match the number of \cells in the \row.

The following control words further define options for each row of the table.

Control word Meaning


\trowd Sets table row defaults.
\tcelld Sets table cell defaults.
\trgaphN Half the space between the cells of a table row in twips.
\cellxN Defines the right boundary of a table cell, including its half of the space between
cells.
\clmgf The first cell in a range of table cells to be merged.
\clmrg Contents of the table cell are merged with those of the preceding cell.
Row Formatting
\trql Left-justifies a table row with respect to its containing column.
\trqr Right-justifies a table row with respect to its containing column.
\trqc Centers a table row with respect to its containing column.
\trleftN Position of the leftmost edge of the table with respect to the left edge of its column.
\trrhN Height of a table row in twips. When 0, the height is sufficient for all the text in the
line; when positive, the height is guaranteed to be at least the specified height;
when negative, the absolute value of the height is used, regardless of the height of
the text in the line.
\trhdr Table row header. This row should appear at the top of every page the current table
appears on.
\trkeep Table row keep together. This row cannot be split by a page break. This property is
assumed to be off unless the control word is present.
Bidirectional
Controls
\rtlrow Cells in this table row will have right-to-left precedence.
\ltrrow Cells in this table row will have left-to-right precedence (the default).
Row Borders
\trbrdrt Table row border top.
\trbrdrl Table row border left.
\trbrdrb Table row border bottom.
\trbrdrr Table row border right.
\trbrdrh Table row border horizontal (inside).
\trbrdrv Table row border vertical (inside).
Cell Borders
\clbrdrb Bottom table cell border.
\clbrdrt Top table cell border.
\clbrdrl Left table cell border.
\clbrdrr Right table cell border.
Cell Shading and
Background Pattern
\clshdngN N is the shading of a table cell in hundredths of a percent. This control should be
included in RTF along with cell border information.
\clbghoriz Specifies a horizontal background pattern for the cell.
\clbgvert Specifies a vertical background pattern for the cell.
\clbgfdiag Specifies a forward diagonal background pattern for the cell (\\\\).
\clbgbdiag Specifies a backward diagonal background pattern for the cell (////).
\clbgcross Specifies a cross background pattern for the cell.
\clbgdcross Specifies a diagonal cross background pattern for the cell.
\clbgdkhor Specifies a dark horizontal background pattern for the cell.
\clbgdkvert Specifies a dark vertical background pattern for the cell.
\clbgdkfdiag Specifies a dark forward diagonal background pattern for the cell (\\\\).
\clbgdkbdiag Specifies a dark backward diagonal background pattern for the cell (////).
\clbgdkcross Specifies a dark cross background pattern for the cell.
\clbgdkdcross Specifies a dark diagonal cross background pattern for the cell.
\clcfpatN N is the line color of the background pattern.
\clcbpatN N is the background color of the background pattern.
Vertical Text
Alignment
\clvertalt Text is top-aligned in cell (the default).
\clvertalc Text is centered vertically in cell.
\clvertalb Text is bottom-aligned in cell.
\cltxlrtb Vertical text aligned left (direction bottom up).
\cltxtbrl Vertical text aligned right (direction top down).

The following is an example of table text:

\par \trowd \trqc\trgaph108\trrh280\trleft36


\clbrdrt\brdrth \clbrdrl\brdrth \clbrdrb\brdrdb
\clbrdrr\brdrdb \cellx3636\clbrdrt\brdrth
\clbrdrl\brdrdb \clbrdrb\brdrdb \clbrdrr\brdrdb
\cellx7236\clbrdrt\brdrth \clbrdrl\brdrdb
\clbrdrb\brdrdb \clbrdrr\brdrdb \cellx10836\pard \intbl
\cell \pard \intbl \cell \pard \intbl \cell \pard \intbl \row
\trowd \trqc\trgaph108\trrh280\trleft36 \clbrdrt\brdrdb
\clbrdrl\brdrth \clbrdrb \brdrsh\brdrs \clbrdrr\brdrdb
\cellx3636\clbrdrt\brdrdb \clbrdr \brdrdb
\clbrdrb\brdrsh\brdrs \clbrdrr\brdrdb
\cellx7236\clbrdrt\brdrdb \clbrdr \brdrdb
\clbrdrb\brdrsh\brdrs \clbrdrr\brdrdb \cellx10836\pard
\intbl \cell \pard \intbl \cell \pard \intbl \cell \pard
\intbl \row \pard

You might also like