Custom Tables have a number of global keywords and there are two that are variable specific.
Label and Scaling Keywords
:TABLE tablename begins the definition of a custom table. tablename will appear in the Graphs tab of the Control Panel.
:CELLWIDTH n defined the width of the cells after the first. This width is specified in characters and should be made big enough so that the table entries do not overrun one another. The default value is 10.
:COMLINE comline specifies a comment to appear on a line. If the comment contains tabs each of the tabs will be placed over a column. The comment before the first tab will not scroll and the parts after the first tab will scroll just as time values do when the user scrolls the table. Note that you can use variable specification ( for example \Population/) in :COMLINE to get values. To enter leading spaces start comline with a vertical bar |. The bar will not be displayed in the output table.
:FIRST-CELLWIDTH n defines the width of the first cell in the table. This width is specified in characters and should be made big enough so that the table entries do not overrun one another. The default value is 20.
:FONT face|size|attrib|color specifies the font to be used in displaying and printing the table. The font has the standard Vensim font (for example Arial|12||0-0-0).
:NOTIMEsuppresses the reporting of Time at the top of the table. The first :VAR or :COMLINE will replace the top line of the table and not scroll out of view.
:PRETTYNUM causes numbers to formatted using Vensim's pretty number formatting conventions. If this is not specified numbers will be printed using scientific notation.
:PRINT-EVERY number - controls the frequency with which results are displayed. This allows you to customize the amount of information being displayed.
:SPECIAL-TIME number - sets the special time for reporting values. The values at SPECIAL-TIME are reported last in the table. If SPECIAL-TIME and X-MAX are the same no values are reported at SPECIAL-TIME.
:TIME-DOWN causes time to run down instead of across.
:TITLE text defines the title of the table. If not specified, the name of the table will be used as its title.
:X-MAX number sets the last time for reporting values.
:X-MIN number sets the first time for reporting values.
Variables on the Table
:VAR var|label specifies the variable to be reported and the label to be used in its reporting. The numbers for the variable will be displayed. You can use Subscript Ranges in the variable name just as for the graph tool. Note that if you use a label for a subscripted variable the label will simply repeat.
:DATASET dataset specifies the dataset to get the variables values from. This applies only to the current :VAR.
:FORMAT format determines the format with which the current variable will be displayed in the table. This can be a prefix for each number such as $ or a standard C language formatting string such as %6.0f to display numbers as whole number. For example you could use %.0f%% for display of percentages as whole numbers (note the final % is doubled following C formatting conventions). This applies only to the current :VAR.
Example
:table table1
:title Population overview
:prettynum
:comline Population runs from \population@1900/ to \population@2100/
:font Arial|10||0-0-0
:var population|How many
:var births
:var deaths
This results in: