Plugin: Columns

Diese Dokuwiki-Erweiterung gestattet das Erstellen von Spalten auf einer Seite.

Syntax

Simply add two lines around your information and enter your column breaks.

The first parameter is the width of the table. The following parameters are for the columns. If you do not want to specify a value for the table- or column-width use “-“ instead.

<columns>

information in column 1

~~NEWCOL~~

information in column 2

</columns>
<columns 100% 50% - ->

information in column 1 (50% width)

~~NEWCOL~~

information in column 2

~~NEWCOL~~

information in column 3

</columns>

Columns2

The syntax is mostly identical to the original version, except that the new column keyword has to be specified within angle brackets1):

<columns 100% 50% - ->

information in column 1 (50% width)

<newcolumn>

information in column 2

<newcolumn>

information in column 3

</columns>

By default the text in columns is justified. This can be changed by adding asterisks on either side of the column width specification. The asterisk indicates non-justified side of the text block, so to achieve left alignment add the asterisk on the right side.

<columns 100% 25% 25%* *-* *->

Justified text

<newcolumn>

Aligned on the left side

<newcolumn>

Center-aligned

<newcolumn>

Aligned on the right side

</columns>

Columns3

Following a number of requests, the plugin is re-designed to support headings and vertical alignment of the columns content. In order to support the new features syntax of the plugin is extended with extra attributes that should be specified in front of the column width:

<columns 100% first column attributes 50% second column attributes ->

Content of the first column.

<newcolumn>

Content of the second column.

</columns>

With this extra attributes the columns declaration gets more and more cluttered. To prevent that you can specify column attributes in the <newcolumn> tag. In this case the order of the attributes and column width is not important:

<columns 100% first column attributes 50%>

Content of the first column.

<newcolumn second column *-* attributes>

Content of the second column.

</columns>

Headings

The headings are specified the using the standard DokuWiki syntax:

<columns 100% 50% ->

===== Heading =====

Content of the first column.

<newcolumn>

Content of the second column.

</columns>

By default plugin puts the content within a column without explicitly specifying the section level. This works fine when the entire columns block belongs to a single section but can produce unexpected results when the headings are used within the block:

====== Level 1 Heading ======

<columns 100% 50% ->

Implicit level 1 content.

===== Level 2 Headline 1 =====

Level 2 content.

<newcolumn>

Implicit level 1 content that should be in level 2 section.

===== Level 2 Headline 2 =====

Level 2 content.

</columns>

You can force the beginning of the second column to be in level 2 by specifying “continue“ attribute (or shorthand “...“):

====== Level 1 Heading ======

<columns 100% 50% ->

Implicit level 1 content.

===== Level 2 Headline 1 =====

Level 2 content.

<newcolumn continue>

Level 2 content.

===== Level 2 Headline 2 =====

Level 2 content.

</columns>

Alignment

The vertical alignment is specified with new alignment attributes. There are four horizontal alignment attributes (left, center, right and justify) and three vertical alignment attributes (top, middle and bottom). There may be multiple alignment attributes per column:

<columns 100% left 50% right bottom ->

Aligned on the left side.

<newcolumn>

Aligned to the right-bottom corner.

</columns>

All attributes can be abbreviated to the first letter, the single letter attributes may be merged together:

<columns 100% l 50%>

Aligned on the left side.

<newcolumn rb>

Aligned to the right-bottom corner.

<newcolumn m *-*>

The old alignment syntax is still supported.
Content of this column is centered both ways.

</columns>

Beispiele

Beispiel: Ein zweispaltiger Text, der 80% Seitebreite in Anspruch nimmt, erste Spalte ist zentriert, zweite Spalte rechtbündig und der Text unten ausgerichtet

<columns 80% center 30% left bottom - >

Überschrift1

Erste Spalte

Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig.

<newcolumn>

Zweite Spalte

Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig. Das ist ein Fließtext zur Überschrift 1 gehörig.

</columns>

Quelle und weitere Informationen

Das Plugin Columns stammt von Michael Arlt.

1) The syntax can be made fully compatible with the original version of plugin by un-checking „Wrap the new column tag“ check box in the Configuration Settings.