Roxen Interactive RXML Help
<tablify></tablify>
Transforms texts into tables. The default behavior is to use tabs as column delimiters and newlines as row delimiters. The values in the first row as assumed to be the title. Note in the example below how empty rows are ignored. As is shown in the last line a row does not need to be complete for tablify to work properly. These missing cells will get as content to force all cells to be drawn if borders are on, thus avoiding broken layout when, e.g. a dynamic variable happens to be empty. No attributes are required for tablify to work.
<tablify border='1'>
X Y Z
3 10 77
1 2 10
4 13 3
1 2
</tablify> | |||||||||||||||
|
Tablify also prescans the entire table to find the widest number of cells.
<tablify border='1'>
A B
a b
aa bb
aaa bbb ops!
</tablify> | ||||||||||||
|
Attributes
- rowseparator
- rowseparator=string (newline)
Defines the character or string used to seperate the rows.
- cellseparator
- cellseparator=string (tab)
Defines the character or string used to seperate the cells.
<tablify cellseparator=','> Element, Mass H, 1.00797 He, 4.0026 Li, 6.939 </tablify>Element Mass H 1.00797 He 4.0026 Li 6.939
- intable
If the intable attribute is set the tablify module will parse the indata as a table.
<tablify nice='1' intable='1'> <table><tr><th>Element</th><th>Mass</th></tr> <tr><td>H</td><td>1.00797</td></tr> <tr><td>He</td><td>4.0026</td></tr> <tr><td>Li</td><td>6.939</td></tr> </table> </tablify>Element Mass H 1.00797 He 4.0026 Li 6.939
- notitle
Don't add a title to the columns and treat the first row in the indata as real data instead.
- interactive-sort
Makes it possible for the user to sort the table with respect to any column.
- sortcol
- sortcol=number
Defines which column to sort the table with respect to. The leftmost column is number 1. Negative value indicate reverse sort order.
- min
- min=number
Decides which of the input rows should be the first one to be displayed. This can be used to skip unwanted rows in the beginning of the data. The first row after the heading is row number 1.
- max
- max=number
Decides which of the input rows should be the last one to be displayed. This can be used to limit the the output to a maximum number of rows.
<tablify min='2' max='4'> Stuff one two three four five six </tablify>Stuff two three four
- negativecolor
- negativecolor=color (#ff0000)
The color of negative values in economic fields.
- border
- border=number
Defines the width of the border. Default is 2 in nice and nicer modes. Otherwise undefined. The value is propagated into the resulting table tag if neither nice nor nicer is used.
- cellspacing
- cellspacing=number
Defines the cellspacing attribute. Default is 0 in nice and nicer modes. Otherwise undefined. The value is propagated into the resulting table tag if neither nice nor nicer is used.
- cellpadding
- cellpadding=number
Defines the cellpadding attribute. Default is 4 in nice and nicer modes. Otherwise undefined. The value is propagated into the resulting table tag if neither nice nor nicer is used.
- width
- width=number
Defines the width of the table.
- cellalign
- cellalign={left, center, right}
Defines how the cell contents should be align by default. The value is propagated into the resulting td tags if neither nice nor nicer is used.
- cellvalign
- cellvalign={top, middle, bottom}
Defines how the cell contents should be verically aligned. The value is propagated into the resulting td tags if neither nice nor nicer is used.
The 'nice' attribute
- nice
Add some extra layout to the table. More specifically it creates a bakcground table with another color and then colors all the cells in the inner table. All attributes below only applies in nice or nicer mode.
<tablify nice='1' cellseparator=','> Element, Mass H, 1.00797 He, 4.0026 Li, 6.939 </tablify>Element Mass H 1.00797 He 4.0026 Li 6.939 <tablify nice='1' cellseparator=',' cellspacing='1'> Element, Mass H, 1.00797 He, 4.0026 Li, 6.939 </tablify>Element Mass H 1.00797 He 4.0026 Li 6.939
- grid
- grid=number
Draws a grid with the thickness given.
<tablify nice='1' grid='1'> Element Mass H 1.00797 He 4.0026 Li 6.939 </tablify>Element Mass H 1.00797 He 4.0026 Li 6.939
- bordercolor
- bordercolor=color (#000000)
The color of the border.
- titlebgcolor
- titlebgcolor=color (#112266)
The background color of the title.
- titlecolor
- titlecolor=color (#ffffff)
The color of the title.
- modulo
- modulo=number
Defines how many rows in a row should have the same color.
<tablify nice='1' cellseparator=',' modulo='2'> Element, Mass H, 1.00797 He, 4.0026 Li, 6.939 Be, 9.0122 B, 10.811 </tablify>Element Mass H 1.00797 He 4.0026 Li 6.939 Be 9.0122 B 10.811
- oddbgcolor
- oddbgcolor=color (#ffffff)
The first background color.
- evenbgcolor
- evenbgcolor=color (#ddeeff)
The second background color.
The 'nicer' attribute
- nicer
Add some extra extra layout to the table. Compared with nice-mode it gtexts the column titles and adds a font-tag in all cells. All attributes below only applies in nicer mode. Nicer requires the gtext module.
<tablify nicer='1'> Element Mass H 1.00797 He 4.0026 Li 6.939 </tablify>H 1.00797 He 4.0026 Li 6.939
- noxml
Don't terminate the images with slashes, as required by XML.
- font
- font=text (lucida)
The font gtext should use to write the column titles with.
<tablify nicer='1' cellseparator=', ' font='andover' fontsize='24'> Element, Mass H, 1.00797 He, 4.0026 Li, 6.939 </tablify>H 1.00797 He 4.0026 Li 6.939
- fontsize
- fontsize=int (13)
The size of the gtext font used to write the column titles with.
- scale
- scale=float
Scales the gtext font used to write the column titles with.
- textcolor
- textcolor=color (#000000)
The color of the text. This will also work with economic fields in any mode.
- size
- size=number (2)
The size of the table text.
- face
- face=string (helvetica,arial)
The font of the table text, e.g. the value of the face attribute in the font tag that encloses every cell.
Defined in content
-
<fields></fields>
The container 'fields' may be used inside the tablify container to describe the type of contents the fields in a column has. Available fields are:
text (default)
left
center
right
num
int
economic-int
float
economic-float
All fields except text overrides the cellvalign attribute.
<tablify nice='nice'> <fields separator=','> text,center,right,float,economic-float,int,economic-int </fields> text center right float economic-float int economic-int 123.14 123.14 123.14 123.14 123.14 123.14 123.14 56.8 56.8 56.8 56.8 56.8 56.8 56.8 -2 -2 -2 -2 -2 -2 -2 </tablify>text center right float economic-float int economic-int 123.14 123.14 123.14 123 . 14 123 . 14 123 123 56.8 56.8 56.8 56 . 8 56 . 8 57 57 -2 -2 -2 -2 . 0 -2 . 0 -2 -2 Attributes
- separator
- separator=string
Defines the field type separator.
The fields types are separated by
The value given in the separator attribute to fields.
The value given in the cellseparator attribute to tablify.
Tab.

