Template:Div col/doc

From Fanlore
Jump to navigation Jump to search

Overview

{{Div col}} formats a bulleted or numbered list into columns that wrap based on screen and browser viewport size. It automatically breaks each column into an equal space, meaning, for instance, it is not necessary to work out the halfway point, or the on-third & two-thirds points between two columns. The use of {{div col}} can make long lists with short entries easier to readers to navigate.

Usage

The most basic usage of {{div col}} consists of enclosing a formatted list inside {{div col}} and {{div col end}}. For example:

{{div col}}
* a
* b
* c
* d
* e
* f
* g
* h
{{div col end}}

Produces:

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

Parameters

  • colwidth: Specifies the minimum width of the columns so that the number of columns is automatically based on screen width (that is, more columns will be shown on wider displays). If no value is supplied, the template uses a default of 30em. The width can be specified in any CSS unit of measure, for instance, the em (about the width of the capital "M" of the displayed typeface), e.g., colwidth=20em.
  • rules: Adds vertical lines ("rules") between the columns if set to yes.
  • gap: Specifies the space between the content of adjacent columns, in any valid CSS width unit, e.g., gap=2em. The default spacing (set by browser) is 1em.
  • class: An HTML class, or multiple space-delimited classes, to apply to the columns.
  • style: CSS styling to apply to the columns.
  • small: Sets font size to 90%.
  • content: Species the content in the columns. If content is specified, closing the template with {{div col end}} is not needed.

Examples

TemplateData

Breaks a list into columns. It automatically breaks each column to an equal space, so you do not manually have to find the half way point on two columns. The list is provided by |content= or closed with {{div col end}}.

Template parameters

ParameterDescriptionTypeStatus
colscols 1

Specifies the number of columns.

Default
2
Numberdeprecated
colwidthcolwidth 2

Specifies the width of columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays. This overrides the 'cols' setting.

Stringoptional
rulesrules

Produces vertical rules between the columns if set to yes.

Stringoptional
gapgap

Specifies the space between the content of adjacent columns.

Stringoptional
stylestyle

Specifies any custom styling.

Stringoptional
contentcontent

Specifies the content.

Stringoptional

Redirects

Copyright