Table Text Formats
September 17, 2001
We've deferred talking about the table format until now, because it is a little more complex than the
text and paragraph formats that we have discussed up until now. In HTML, tables are typically created
something like this:
<table border=1>
<tr>
<td>Paul Klee</td>
<td>Abstract Expressionism</td>
</tr>
<tr>
<td>Max Ernst</td>
<td>Surrealism</td>
</tr>
</table>
The <table> element contains the <tr> (table row) element, which in turn contains the <td> (table
cell) element. Indeed as the table text format resembles the HTML <table> element, so it stands to
reason that you will need to use more than one type of format within table.
The table format forms the topmost container expression, which can contain the following formats:
-
row for each row in the table
-
header-row for the top row in the table
-
cell for each cell in the table
-
header-cell for the topmost cells in the first row
In the hierarchical structure, this would take the following form:
{table ...
{header-row
{header-cell}
{header-cell}
}
{row
{cell}
{cell}
}
...
}
The header rows and header cells aren't obligatory, but they are there to help with the differentiation
between the title row of the table and the contents rows beneath.
To create just a basic table all you need is the following code. Here we've used it to display the names of
two famous 20th century artists:
|| table.curl
{curl 1.7 applet}
{applet license = "development"}
{table
{row
{cell Paul Klee}
{cell Abstract Expressionism}
}
{row
{cell Max Ernst }
{cell Surrealism}
}
}
Without any extra information, the table is displayed without any borders or stylistic information as follows:
The header-row and header-cells can be added to tables, to help the title stand out, as they contain some
implicit styling information. We could alter the previous table so that it contained some header
information giving extra details about the data contained with the table as follows:
|| table2.curl
{curl 1.7 applet}
{applet license = "development"}
{table
{header-row
{header-cell Artist}
{header-cell Movement}
}
{row
{cell Paul Klee}
{cell Abstract Expressionism}
}
{row
{cell Max Ernst }
{cell Surrealism}
}
}
This would then be displayed as follows:
This is the default mode of display when using the just the table text formats.
Definition Lists
Early Adopter Curl
Table Text Options
|