Tables and axes > Using axes as columns > Fully automatic set-up
 
Fully automatic set-up
With this method, the width of the column is calculated automatically and the text of the breakdown is taken from the row text of the count-creating statements in the axis. Long texts are broken up by Quantum.
The width of each column is calculated by dividing the maximum width available for the table heading by the number of columns required. If the table is 132 columns wide with a row-text width of 24 (both defaults), the maximum heading with will be:
132 - (24 + 1 + 0) = 109 characters
If the axis has ten count-creating elements, each column will be allocated ten spaces. If there are 15 count-creating elements, each one would be seven characters wide.
The maximum and minimum column widths allowed are 16 and eight characters respectively. If the result of the division is greater than 16, the column width is set to 16 characters; if the result is less than eight, the column width is set to eight characters.
The overall column headings are also generated automatically. The top line contains the axis heading (from hd= on the l statement) centered across the entire breakdown. The second line contains the axis subheadings (from an n23 statement or hd= on a col or val) centered across the columns to which they refer. The text for each column is taken from the relevant n01/col/val statement. This text is split up above the column as logically as possible, using spaces, hyphens or slashes in the text as breakpoints. Column headings are right-justified and can be split over four lines. An example is:
l region;hd=Area of Residence
col 15;Base;hd=London;Inner London;Outer London;
+hd=Southern England;Cornwall/Devon;Kent/Surrey/Sussex; ...
which gives:
Area of Residence                                    

London Southern England

Kent/
Inner Outer Cornwall/ Surrey/
Base London London Devon Sussex
Each column is 11 characters wide. The axis heading ‘Area of residence’ is centered over all columns, including the base, whereas the axis subheadings are centered over the columns to which they refer.
If you would prefer left or right justified subheadings, use hdpos on the n23 statements. For more information about the positioning of subheadings across columns, see Laying out subheadings.
If the axis contains more than one n23 subheading, the text on each one will be centered above the elements between it and the next n23 or the end of the axis. If you want to alter this so that you can create blocks of text above the same group of columns, set up nested headings using hdlev= on the n23 statement. For information about setting up nested headings using hdlev=, see Nested subheadings for column axes.
For example:
l ban01
n23Visitors to the Museum;hdlev=1
n10Base
n23Sex;hdlev=2
col 110;Male;Female
n23Age;hdlev=2
col 111;11-20='12';21-34='34';35-44='56';55+='78'
n23Visited;hdlev=2
n23Museum Before;hdlev=2
col 116;Yes;No
This might print as:
Visitors to the Museum                                
Visited
Sex Age Museum Before
Base Male Female 11-20 21-34 35-54 55+ Yes No
To use a different text for when an element forms a column in a table, define this text with the option toptext= on the element. For example, to replace the two-line heading Visited Museum Before with the single line Been Before, write:
l ban01
n23Visitors to the Museum;hdlev=1
n10Base
n23Sex;hdlev=2
col 110;Male;Female n23Age;hdlev=2
col 111;11-20='12';21-34='34';35-44='56';55+='78'
n23Visited Museum Before;hdlev=2;toptext=Been Before
col 116;Yes;No
With the default of centralized texts, the headings might be printed as:
Visitors to the Museum                                  
Sex Age Been Before
Base Male Female 11-20 21-34 35-54 55+ Yes No
Absolute figures are printed with the right-most digit one print position to the left of the right-most character in the column heading. Percentages are printed with the right-most digit under the right-most character in the column text, unless flush or pcpos are present on the a, sectbeg, flt or tab statement. If flush is used, percentages are printed directly under absolutes. For example:
Without FLUSH (default):
Male Female
44 56
31% 39%
With FLUSH:
Male Female
 44 56
 31% 39%
If pcpos is used, percentages are positioned according to the offset given:
With PCPOS=-1:
   Male Female
    44 56
   31% 39%
With PCPOS=1:
Male Female
 44 56
  31% 39%
When Quantum prints column headings, it prints two blank lines before the first line of text and one blank line after the last line. You can change one or both of these settings using the keywords linesbef= and/or linesaft= on the a, flt, setbeg or tab statement. For example, if you type:
a;linesbef=3;linesaft=2
Quantum prints three blank lines before column headings and two blank lines after them in all tables in the run.
See also
Using axes as columns