[column]

Output two column formatted text, adapted to fit the target printer.

Shorthand

It is acceptable to use the abbreviations two-column , col , or 2col instead of the full command name column .
So the command sequence [col] and [column] are equivalent.

Parameters

Several parameters can be provided to either configure column layout, ow output a formatted column.
Alternatively, if the [column] command is used without any parameters, then it will simply reset any configuration values, such as the indent to their defaults.

Parameter

Description

left

Specify the left hand text for a column.

right

Specify the right hand text for a column.

short

Provide an optional shortened version of the left hand column data, to be used if the full version will not fit the the available print width.

indent

Set a left hand indent size, in printer dots, mm or percentage of print width.
If this is a negative value, then the indent will be measured from the right hand side of the page, by subtracting it from the total print width.
Note that the new indent value will affect subsequent columns until it is reset/changed.

How to use

The column command handles a common requirement for point of sale printers in a way that hides differences between device capabilities, font sizes, paper width etc.

When using, if one of more of the left , right and short parameters are provided, then a single row of a column will be printed.
If the available print area is too narrow to print a column row based on the left and right parameter data (with the currently specified font), the the short parameter value will be used instead of left .
Finally, if there is still not enough space to print a single line column, then a two column layout will be used instead.
Optionally, an indent parameter value may be specified to set the left hand margin of the column.
This can be set without needing to specify any column data, and it’s value will affect all following rows, until the indent is changed or reset.
It is also allowed to specify a negative indent value, which will still set the left hand margin of the column, but measured from the right side of the print area.

Example

Markup

This is a simple markup example, using only the [column] and [cut] commands.

Column Example

Simple Column:
[column: left Item 1; right 1.00]
[column: left Item 2; right 1.00]
[column: left Item 3; right 1.00]

Column with Item fitting:
[column: left This is a description of Item One;
        short Item 1;
        right 1.00]
[column: left This is a description of Item Two;
        short Item 2;
        right 1.00]
[column: left This is a description of Item Three;
        short Item 3;
        right 1.00]

Indented Column:
[column: left Item 1; right 1.00; indent 5mm]
[column: left Item 2; right 1.00]
[column: left Item 3; right 1.00]

Indented from right:
[col: indent -20mm]\
[column: left Item 1; right 1.00]
[column: left Item 2; right 1.00]
[column: left Item 3; right 1.00]

[cut]\

Output at 58mm

This is the result when using the markup processor to sent to an mC-Print2 58mm(2inch) printer.

../../_images/column_58mm.jpg

Output at 80mm

This is the result when using the markup processor to sent to a TSP650II 80mm(3inch) printer.

../../_images/column_80mm.jpg