Document Table
The doctable environment is a general purpose table for use in a various types of documents. It is derived from the tabular and accepts the same set of arguments, many of which are only needed in special circumstances.
\begin{doctable}[
ncols=2
width=#]
headalign='c|c'
colalign='l|l'
colwidth='x|y|z'
colclass=x|y|z
style=names]
\headers{header-1}{header-2}{header-3} ....
\row{col1-value}{col2-value}{col3-value} ....
\rule
\rule{width}
\span[align=l|c|r]{text}
\end{doctable}
- ncols
-
The number of columns in the table. The default is 2.
- width
-
The width of the table. The default is use to use the natural width.
- headalign
-
Specifies the text alignment for the column headers. None are specified by default. The value of this argument must be specified as a sequence of single letters separated by a vertical bar
headalign=l|c|r
with one letter for each column. The letters used to specify the header alignment are shown below:
Value Description l align left c align center r align right To use the default alignment for a column, the letter can be omitted, but the vertical bar is still required:
headalign=l||r
- colalign
-
Indicates the text alignment within each column. None are specified by default. This argument takes a string similar to that used with headalign.
- colwidth
-
Defines the width of each column. No widths are specified by default. The column widths are specified as a sequence of css widths separated by a vertical bar (|).
colwidth='50%|30%|20%'
As with the head and column alignments, a width can be omitted to use the natural width, but all vertical bars must be provided.
colwidth='|50%|'
- colclass
-
The class name to assign to the <td> elements of each column. None are specified by default. The class names are specified in the same format as the other column specific parameters.
colclass='args|descp|notes'
- style
-
Class name(s) appended to the table's class name. This allows for additional styling of the default tables. For example, style='zebra ruled' can be used to create a zebra striped and single ruled basic table.
Example
The table definition below produces a simple ruled and zebra striped document table
- \begin{doctable}
- \headers{Column A}{Column B}
- \row{a}{b}
- \row{c}{d}
- \row{e | f}{x}
- \row{g}{h}
- \end{doctable}
| Column A | Column B |
|---|---|
| a | b |
| c | d |
| e | f | x |
| g | h |