Since Release 5 you are able to print simple tables with UDO. You can define the justification of the columns and where UDO shall print vertical and/or horizontal lines.
To print tables with UDO you need the following commands:
The command !table_caption defines the title of the next table. It has to be used before the table environment, not inside this environment!
The command !begin_table starts a table,
!end_table finishes and prints the table. After
!begin_table you can define the justification of the table
columns and the usage of vertical lines. Use c
for a centred row, l
for a left justified row,
r
for a right justified row, and
|
for vertical lines inside brackets. If you
add a !hline command to this line the table starts
with a horizontal line.
After having described the layout of the table with the upper line
you can insert the cells of the table. You have to insert a column in
one source line and you have to divide the cells by using !!
.
If you want to insert a horizontal line you can use the !hline command. !hline has to be at the beginning of the line and it has to be the only command of this line.
Here you will see a short example that demonstrates the usage of the upper described commands:
!table_caption Tables with UDO !begin_table [|l|c|r|] !hline upper left !! up !! upper right lower left cell !! lower cell !! lower right cell !hline !end_table
This example prints a table with two rows and three columns. The first column is left justified, the second columns is centred and the third columns is printed right justified:
upper left | up | upper right |
lower left cell | lower cell | lower right cell |
Because I used a |
before and after every
column they are divided by vertical lines. The table starts with a
horizontal line because the !hline command was added
at the end of !begin_table. Finally the table ends with a
horizontal line because the !hline command is used
right before !end_table.
The following example shows the upper table without any lines:
upper left | up | upper right |
lower left cell | lower cell | lower right cell |
UDO offers you a switch called !use_ansi_tables. If you use this switch inside the preamble the lines of the table are printed by using some characters of the IBM PC graphic character set instead of +, - and | when converting into an ASCII like format like ASCII or ST-Guide. This switch has no effect if you convert to Windows Help, RTF, HTML or LaTeX.
Hints:
Tables are always output centered. But using the preamble command !table_alignment, you can even define another alignment for tables.
HTML doesn't allow to define where to use lines. If you use the !hline command at the end of !begin_table the table is printed via frame=box. If you don't use !hline it is printed without any lines.
Windows Help doesn't allow it to print centred tables or to print lines where you want to. If you use !hline in the !begin_table line all cells will be printed with a box. If you don't use !hline there will be no line at all in this table.
Converting to ST-Guide the lines of a table are generated with @line. It's not possible to use more than one vertical line between columns or more than one horizontal line.
Inside the cells you can use all other UDO commands like text styles, links or indices.