ESSENTIAL CODE ELEMENTS FOR EASY TABLES:
RETURN TO THE TOP
GO TO THE NEXT SECTION
For making Easy Tables, there are two symbols used to form the most basic table elements:
| (pipe)
- (minus or hyphen)
How these are combined govern how tables appear in a message. To create a basic table with one row of three cells, your code should look something like:
| Cell 1 | Cell 2 | Cell 3 |
|
The pipe symbol on the second line acts to trigger the system to display this code as a table. This trigger is
necessary for a table with only one row to display properly. This example will appear in a post or other RPoL document as:
Here's how it looks without the pipe in the second row:
| Cell 1 | Cell 2 | Cell 3 |
HEADERS:
Since tables usually run across multiple columns and rows, and can use headers to identify data in cells below them, now would be a good time to build a simple table with some headers:
| Header 1 | Header 2 | Header 3 |
|-
would appear as:
Note in the above example that the
|- is enough to trigger the entire line above it to be displayed in header format: a colored background with bold print center aligned. The default colors for the font and background vary per the theme settings in
User Preferences. This means someone else may not see the same colors as the creator of a particular table does.
Trailing (end-of-line) pipe symbols are optional. Thus:
| Header 1 | Header 2 | Header 3 <-- Note no pipe symbol to end the line!
|-
should produce the same output as the above:
One could actually use just these two symbols to build a useful table:
| Header | Header | Header |
|--------|--------|--------|
| Cell 1 | Cell 2 | Cell 3 |
would appear as:
Header | Header | Header |
---|
Cell 1 | Cell 2 | Cell 3 |
and...
| Header | Header | Header |
|-
| Cell 1 | Cell 2 | Cell 3 |
Would appear the very same:
Header | Header | Header |
---|
Cell 1 | Cell 2 | Cell 3 |
Note that no trailing line with a pipe symbol is required for multi-row tables such as these. The trigger is already present with the creation of the second row.
This table could also be coded without white space as:
|Header|Header|Header| <--Note there is no white space in this row.
|- (at least none that is not part of the data...)
|Cell 1|Cell 2|Cell 3| <--Nor is there any in this row.
Header | Header | Header |
---|
Cell 1 | Cell 2 | Cell 3 |
which looks the same as the previous two examples.
SETTING COLUMN WIDTHS:
One might wonder why would it profit to include all those extra characters if |- gets the job done? There is an alternate format:
| Header | Header | Header |50%
|50%-----|30%-----|20%-----|
| Cell 1 | Cell 2 | Cell 3 |
which causes the individual columns to be set to widths which are percentages of the overall table width (which, in this instance is also constrained to a percentage of the message frame width). This yields:
Header | Header | Header |
---|
Cell 1 | Cell 2 | Cell 3 |
General rules for setting column widths as percentages of table width:
- If fuller control of overall table width is desired, first specify a percentage value at the end of the first line of table code. This sets the overall table width as a percentage of the message frame's width.
- Whether an overall table width is specified or not, the total of column width percentages specified should add up to 100% (of the table's constrained width).
NOTE: If the overall table width is not specified, the coder
has no control over what width is displayed:
| Header | Header | Header |
|-50%----|-30%----|-20%----|
| Cell 1 | Cell 2 | Cell 3 |
yields:
Header | Header | Header |
---|
Cell 1 | Cell 2 | Cell 3 |
As a working theory, this width appears to be governed by the size of the least width needed to properly display the contents of the longest data string in narrowest column. By way of verification, expanding the content of Cell 3 produces:
Header | Header | Header |
---|
Cell 1 | Cell 2 | Cell 3 expanded |
Beware the unintended effect of expanding a cell too much:
Header | Header | Header |
---|
Cell 1 | Cell 2 | Cell 3 expanded to a ridiculous length |
In each case, since column 3 is specified to the narrowest width, it's contents set the actual displayed width of the entire table. This seems to bear out the working theory put forth above. This gives us even more reason to be mindful of the content of cells in an Easy Table, and that content's possible
unintended effects on an entire table.
In the next section we explore how to make simple grids.
RETURN TO THE TOP
GO TO THE NEXT SECTION
This message was last edited by the GM at 21:02, Sun 19 May 2019.