Template:Div col: Difference between revisions

From Linguifex
Jump to navigation Jump to search
(Created page with "<includeonly><div class="div-col columns <!-- -->{{#if: {{{colwidth|{{{2|}}}}}} | column-width | column-count column-count-{{{cols|{{#if:1|{{{1|2}}}}}}}} }}" style="<...")
 
No edit summary
Line 17: Line 17:
     | {{{style}}} }}"><!--
     | {{{style}}} }}"><!--
  -->{{#if: {{{content|}}}
  -->{{#if: {{{content|}}}
     |{{{content}}}</div>}}<!-- Inventory how many pages use small=yes
     |{{{content}}}</div>}}}}</includeonly><noinclude>
-->{{#ifeq: {{{small|}}}|yes
    |[[Category:Pages using div col with small parameter]]}}</includeonly><noinclude>
{{Documentation}}
{{Documentation}}
</noinclude>
</noinclude>

Revision as of 13:34, 5 March 2024




Template:CSS3 multiple column layout

{{Div col}}, together with {{div col end}}, is used to make a list into columns. It automatically breaks each column into an equal space, meaning, for instance, it isn't necessary to work out the halfway point between two columns. The template also offers options to set a smaller (90%) font-size (|small=yes), place vertical lines ("rules") between the columns (|rules=) and to add other custom styling (|style=).

{{Div col}} can create multiple columns in web browsers which support one of the following CSS properties:

Usage

|colwidth= Template:Nobold
Specifies the minimum width of the columns and determines automatically the number of columns based on screen width (i.e. more columns will be shown on wider displays). Overrides cols.
|rules=
Adds vertical lines ("rules") between the columns if set to yes or some CSS styling (e.g. 1px dashed blue;).
|gap=
Specifies the space between the content of adjacent columns. The default spacing is 1em.
|style=
CSS styling to apply to the columns.

Examples

{{Div col}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|3}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col||10em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|rules=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
produces
}}
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h