7.2 Tables
Tables are produced in much the same way as figures, except that the table environment is used instead.
Where the optional argument <placement specifiers> is as described earlier.
As mentioned at the start of this chapter,
tables typically have the caption at the top of the
table [17]. With the KOMA-Script classes, such as
scrartcl, scrreprt and scrbook, use the class
option captions=tableabove to ensure that the vertical
spacing appears correctly between the caption and the table content
and put \caption
at the start of the table
environment. [Tables longer than a single page]Page
breaks are not permitted in the table
environment. (The longtable package can be used for that
instead. See the longtable documentation for
further details.)
Example:
In the preamble:
Later in the document:
Again, the \centering
declaration is used to centre the
tabular environment.
As with figures, you can create a list of tables using the command
This creates a file with the extension .lot (see §2.4. Auxiliary Files). As with the table of contents and list of figures, you will need to LaTeX your document twice to get the list of tables up-to-date, unless you're using latexmk (as described in §5.5. Cross-Referencing) in which case it will be done automatically.
Exercise 17: Creating TablesIf you did Exercise 7, you should have a tabular environment in your document. Try turning this into a table, and add Table 7.1. You could also try adding a list of tables. As before, you can download or view the solution.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).