Table numbers
Quick reference
To print table numbers, type:
tbx [number] [;nand]
where x determines the position of the table number on the line and is one of l for left justified, r for right justified, c for centered, or a or b for alternate justification. tba prints on the left on the first, third, and so on, pages, while tbb prints on the left on the second, fourth, and so on, pages.
nand forces tables created by and statements to have the same table number as the parent tab statement.
Alternatively, type:
<<tab>>
on a tt statement.
More information
Table numbers are not printed unless you request them either with a tb statement, or with the notation <<tab>> on a tt statement. The format of the tb statement is:
tbl n
or
tbr n
or
tbc n
to have table numbers printed at the top left of the table, at the top right of the table, or centrally within the page width. In all three cases, n is the number the next table is to have.
If tables are to be numbered consecutively from the given table number, only one tb statement is required. However, if some tables have non-consecutive numbers, the tab statements creating these tables must be preceded by a tb with the appropriate number:
tbl 5
tab brand region
tbl 9
tab tried region
You might need to do this when you are rerunning a selection of tables from a previous job.
Table numbers can also be defined on tba and tbb statements so that their justification moves from left to right justification on alternate pages. If a title is defined on a tba statement, it is printed left justified if it is on the first, third, fifth page, and so on, and right justified if it is in the second, fourth, sixth page, and so on. If a title is defined on a ttb statement, the reverse is true; that is right justification on first page, left justification on the second page, and so on.
Tables generated by and statements are generally assigned individual table numbers even though they all come from the same statement. If you prefer, you can force all tables created by ands to have the same table number as the table on the tab statement. This option is invoked by the option nand on the tb statement:
tbr 1;nand
To switch off table numbering once it has been initiated, use the option notbl. To reset table numbering, enter another tb statement carrying the required table number as before.
For more control over the positioning of the table number, switch off the automatic table numbering with notbl and define the table number on a tt statement, using the notation:
<<tab>>
to mark the position in which the table number is to be printed.
For example:
tab age sex
ttlTable <<tab>>: Age by Sex
When the table is created, Quantum substitutes the appropriate table number in place of <<tab>>. Since the title is defined on a ttl statement, the table number is printed left-justified at the top of the table, together with any other titles from the axes.
You can use this notation on tt statements at any position, either inside or outside the axis.
Quantum numbers the tables sequentially from 1, as it does when you use tb. If you want to force a table to have a specific number, use a tb statement with the required number just before that table.
Example
a;dsp;op=12;notbl
tba 1
tab age sex
ttlTable <<tab>>: Age by Sex
tab marry sex
foot
ttl
ttl
ttcTable <<tab>>: Marital Status by Sex
tba 10
tab prefer region
l region
ttlTable <<tab>>: Regional breakdown
In this example, the first table is Table 1, and this text is printed at the top left corner of the page. The second table is Table 2. The title is printed at the foot of the table, separated from the last line of the table by two blank lines. The third table is Table 10. This text is printed at the top left corner of the page. Notice, that this title is defined as part of the row axis.
See also