|
Cookbook /
CreateColumnsSummary: quickly divides up a list of items into separate columns within a table
Version: 2010-12-16
Prerequisites: none
Status:
Maintainer: overtones99
Questions answered by this recipe
DescriptionCreateColumns quickly divides up a list of items into separate columns within a table and outputs the necessary PmWiki Working examples can be found here: http://plus1plus1plus.org/Resources/PmWiki-CreateColumns NotesTo install, add createColumns.phpΔ to your Cookbook, and add to your
Usage & Basic FormatThe following markup creates a table with 3 items per column, in this case resulting in 2 columns... (:createColumns perColumn=3 tableOptions="width=90% align=center" cellOptions="align=center":) item 1 item 2 item 3 item 4 item 5 (:createColumnsend:) ... which basically just outputs the following PmWiki table markup: (:table width=90% align=center:) (:cellnr cellOptions="align=center":) item 1 item 2 item 3 (:cell cellOptions="align=center":) item 4 item 5 (:tableend:) Adding more items to the list would eventually lead to the automatic addition of more columns. Additionally, you can instead specify a finite number of columns, and CreateColumns will divide up the list evenly. For example: (:createColumns nColumns=3 tableOptions="width=90% align=center" cellOptions="align=center":) item 1 item 2 item 3 item 4 item 5 (:createColumnsend:) ... which results in: (:table width=90% align=center:) (:cellnr cellOptions="align=center":) item 1 item 2 (:cell cellOptions="align=center":) item 3 item 4 (:cell cellOptions="align=center":) item 5 (:tableend:) Arguments
Inserting a List into a Pre-Existing Table via tableMarkup=0It's also possible to insert CreateColumns into a pre-existing table by specifying (:table width=90% border=1:) (:cellnr:)yeah yeah yeah (:cell:)uh huh (:createColumns nColumns=3 tableMarkup=0 cellOptions="align=center":) item 1 item 2 item 3 item 4 item 5 (:createColumnsend:) (:tableend:) ... will result in: (:table width=90% border=1:) (:cellnr:)yeah yeah yeah (:cell:)uh huh (:cellnr cellOptions="align=center":) item 1 item 2 (:cell cellOptions="align=center":) item 3 item 4 (:cell cellOptions="align=center":) item 5 (:tableend:) Release notes
See alsoContributorsCommentsUser notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |