Tables
Tables are probably the trickiest part of RTF to read and write correctly. Because of the way Microsoft word processors implement tables, and the table-driven approach of many Microsoft RTF readers, it is very easy to write tables in RTF that will crash Microsoft word processors when you try to read the RTF. Here are some guidelines to reduce problems with tables in RTF:
-
Place the entire table definition before any paragraph properties, including \pard.
-
Make sure the number of cells in the RTF matches the number of cell definitions.
-
Some controls must be the same in all paragraphs in a row. In particular, all paragraphs in a row must have the same positioning controls, and all paragraphs in a row must have \intbl specified.
-
Do not use the \sbys control inside a table. \sbys is a holdover from Word for MS-DOS and early versions of Word for the Macintosh. Word for Windows and current versions of Word for the Macintosh translate \sbys as a table. Because Word for Windows and Word for the Macintosh do not support nested tables, these products will probably crash if you specify \sbys in a table.
-
Cell definitions starting before the left margin of the paper begins (that is, the parameter plus the left margin is negative) are always in error.
-
Even though nested tables are not explicitly defined in RTF, and Word for Windows and Word for the Macintosh do not support nested tables, you must still save table properties when changing destinations because tables can be nested inside other destinations—that is, you can have a table that contains a footnote or an annotation, and the footnote or annotation can contain another table.