Revision [8902]

This is an old revision of ArrayToColumns made by JavaWoman on 2005-06-07 09:56:21.

 

Generating Columns from an Array


See also:
This page presents new code for the WikkaCore Wikka Core to generate columns of items from an array of items to be presented - without using a table for layout.

Why?


In many cases we get an array back from some procedure and want to display the result in the form of a number of easy to read columns. The current Wikka code now does this "manually" and generates a table layout which is not only very structural code but also not very accessible. (Example: the CategoryActionInfo Category action can generate its output in "columns" but they need to be read horizontally rather than vertically - making it hard to "scan" so a particular name is hard to find - and the code generated is a layout table.)

Using a standard way to generate columns is more efficient, can ensure consistent and structural code and makes it easier to write methods that need columns of items as output.

How?


Two separate methods were written to make it easy to generate well-structured columns with 'hooks' for styling: the first does nothing but generate a list from an array (with an id); the second wraps that in a bit of code with a heading and a bit of text instead of the list if the array happens to be empty.

The Code



When and where to use



Status




CategoryDevelopmentCore
There is one comment on this page. [Display comment]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki