Template:Columns-list

From GodWiki
Jump to: navigation, search
[view] [edit] [history] [refresh]
Documentation  Documentation
Important.png

Do Not Use

Due to a Godwiki limitation (see § List balancing), this template currently produces undesirable results.
Use of {{Div col}} and HTML lists is recommended as an alternative.

This template is for use in a list in the body of an article, rather than in a navigation template like Navboxes.

Use

The width of each column may be specified using |colwidth= and a value in ems.

{{columns-list|colwidth=width|
Text (usually a list)
}}

Here, width specifies the width of the columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays.

If |colwidth= is not specified, the default width of 20em will be used.

This template uses CSS3 multiple-column layout, which is not supported by all browsers.

Examples

Here is an example
{{columns-list|colwidth=15em|
* [[Artifact]]
* [[Equipment]]
* [[Monster]]
* [[Town]]
* [[Quest]]
}}
which would render as

CSS styles can also be added in addition to the colwidth parameter.

For example
{{columns-list|colwidth=15em|style=width: 30em; font-style: italic; border: 1px solid black;|
* [[Artifact]]
* [[Equipment]]
* [[Monster]]
* [[Town]]
* [[Quest]]
}}
which would render as

Error messages

The presence of an equals sign within the template's content can also cause display problems and red error messages. To fix this problem, add |1= in front of the template's content.

List balancing

Unfortunately, with the current Godwiki site CSS, certain skins render an unbalanced columns list with one fewer item in the first column than in subsequent columns. (Both "Desktop" views are affected, however the "Mobile" view is not.)

This is due to a list margin which makes the first column "shorter" than the others (able to hold fewer items). It can be avoided by creating the list with HTML, rather than wikitext, and applying a style of margin-top:0. This requires the use of {{Div col}} rather than {{Columns-list}}:

{{Div col|colwidth=15em}}
<ul style="margin-top: 0;">
<li>[[Artifact]]</li>
<li>[[Equipment]]</li>
<li>[[Monster]]</li>
<li>[[Town]]</li>
<li>[[Quest]]</li></ul>
{{Div col end}}
which produces