• Login
  • login to access premium content (it's free).

LAYOUT()

A new way to use layout

The layout tag is usually used to take an Aestiva table and create some html markup with it. For example

 mystuff
+-----------------------+
| Dog   | Cat   | Mouse |
|-------+-------+-------|
| Blue  | Green | Red   |
+-----------------------+

Could be displayed as a table like this using layout()

<table>
 <<layout(mystuff,'<tr><td>',[1],'</td><td>',[2],'</td><td>',[3],'</td></tr>')>>
</table>
DogCatMouse
BlueGreenRed

But...

There is another very useful way to use layout

It can be used to extract columns from a variable and place them into a new variable. For example using the variable mystuff we could extract the third and the first column in that order using layout.

newvar=layout(mystuff,[3],[1])

Which would yield newvar...

 newvar
+---------------+
| Mouse | Dog   |
|-------+-------|
| Red   | Blue  |
+---------------+