This macro isn't bundled with any XWiki product by default.
Macro contributed by Thomas Eveilleau.
This macro can be downloaded.

Column Macro

Allow you to easily create columns in the content of a page

Usage

#column(number of columns, justify, border)

Parameters definition

NameOptionalAllowed valuesDefault valueDescription
Number of columnsno2,3,4noneNumber of columns you want to display
Justifyyestruenone"true" to justify the text
Borderyestruenone"true" to add borders (black, 1px, solid)

Example

#column("2" "true" "false")
content of my first column
#endcolumn()
#column("2" "true" "false")
content of my second column
#endcolumn()

Result

2columns.png

Installation

This a Velocity macro. Since it's not bundled by default you'll have to copy/paste the following code to use it:

#macro(column $columns $justify $border)
#if($columns==2)
#set($width="48%")
#elseif($columns==3)
#set($width="32%")
#elseif($columns==4)
#set($width="23%")
#else
#set($width="23%")
#end
<div style="float:left;width:${width};padding:5px;#if($justify=="true")text-align:justify;#end #if($border=="true")border:1px solid black;#end">
#end

#macro(endcolumn) </div> #end

Version 10.1 last modified by VincentMassol on 19/06/2008 at 21:59

Comments 0

No comments for this document

Attachments 1

Image
2columns.png 1.1
PostedBy: ThomasEveilleau on 05/05/2008 (53kb )

Creator: ThomasEveilleau on 2008/05/05 18:34
This wiki is licensed under a Creative Commons license
1.4.1.10194