INPUT /  OUTPUT /  LANGUAGE






table tag

Category: presentation container tag

Creates a table object on the screen which allows content to be formatted into rows and columns.

Sample usage

<table
    <tabRow {A},{B},{C}>
    <tabRow  1,  2,  3 >
>
— creates a table with 2 rows and 3 columns. The top row contains A B C and the bottom row contains 1 2 3.

Fields

Primary field

Category: presentation container field

The primary field should contain one or more tabRow tags, corresponding to the rows of the table.

Add multiple tabRow tags for a table with multiple rows.

Secondary fields

Behaviour

The table tag is not designed to store content directly; each row of content must be wrapped in a tabRow tag. (An array may be used to generate multiple tabRow tags if required.)

A table is made up of aligned rows and columns of content. Each tabRow inside the table defines an entire row, and each item of data within the tabRow defines the content to be placed in each column within that row.

Example

The following example renders a grid of calculator buttons on the screen. A custom class is used to give all the calculator buttons consistent behaviour. When a button is clicked, a character corresponding to that button is sent to the program's standard input.


<calcButton:class char=char _=caption
    *=<span 
        <char:scalar>,
        <caption:button width=2.5,em onClick=<putLn char>>
    >
>

<table
    <tabRow 
        <calcButton char={A} {AC}>,
        <calcButton char={C} {C}>,
        <calcButton char={P} {%}>,
        <calcButton char={D} {DEL}>
    >
    <tabRow 
        <calcButton char={7} {7}>,
        <calcButton char={8} {8}>,
        <calcButton char={9} {9}>,
        <calcButton char={/} {÷}>
    >
    <tabRow 
        <calcButton char={4} {4}>,
        <calcButton char={5} {5}>,
        <calcButton char={6} {6}>,
        <calcButton char={*} {×}>
    >
    <tabRow 
        <calcButton char={1} {1}>,
        <calcButton char={2} {2}>,
        <calcButton char={3} {3}>,
        <calcButton char={-} {-}>
    >
    <tabRow 
        <calcButton char={0} {0}>,
        <calcButton char={.} {.}>,
        <calcButton char={=} {=}>,
        <calcButton char={+} {+}>
    >
>

AC
C
%
DEL
7
8
9
÷
4
5
6
×
1
2
3
-
0
.
=
+