Search Locate Previous Next Contents

Horizontal Alignment of Column Titles

By default, NewLeaf centres each line of a column title in its cell. As with a table, you can specify a single horizontal alignment to be applied to all column titles:

nlInit ª nlUse''
nltTitles districts
nltTAlign 'right'
nltList salesQ1
View doc„nlClose

You can align each column title independently by specifying a vector of one or more horizontal alignment settings. NewLeaf reshapes this vector as required to match the number of columns. For example, to left- and right-align alternate columns of a table and its column titles:

nlInit ª nlUse''
nltAlign 'left' 'right'
nltTitles districts
nltTAlign 'left' 'right'
nltList salesQ1
View doc„nlClose

Finally, look at the effect of right-aligning the titles of all but the first and last columns of the sales report. As there is no title for the first column, the horizontal alignment setting has no effect:

nlInit ª nlUse''
nltFont (›'TI,10'),((¯1+¯1†½salesQ1)½›'HE,10'),›'HEB,10'
nltQfmt (›''),((¯1+¯1†½salesQ1)½›'CF8.1'),›'CF9.1'
nltAlign (›'left'),(¯1†½salesQ1)½›'decimal1'
nltCellWidths 72×0.9,((¯1+¯1†½salesQ1)½0.75),0.8
nltGridlines 1,(›0.5,(1-¯1†½salesQ1)†0.5),0
nltSpacing 1 1
nltTitles (›''),(¯1‡›[1]regions,[0.5]districts),¯1†districts
nltTAlign (›'centre'),((¯1+¯1†½salesQ1)½›'right'),›'centre'
nltList ¯1‡[1]products,salesQ1
nltRule 0.5
nltSpacing 3 3
nltList ¯1†[1]products,salesQ1
View doc„nlClose


Continue to: Column Titles Font
© Copyright Causeway Graphical Systems Ltd 2001