Editing Template:Div col

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
<includeonly>
+
<includeonly><templatestyles src="Div col/styles.css"/><!--
<div class="div-col {{#ifeq:{{{small|}}}|yes|div-col-small}} {{#ifeq:{{{rules|}}}|yes|div-col-rules}}"  
+
--><div class="div-col {{#ifeq:{{{small|}}}|yes|div-col-small}} {{#ifeq:{{{rules|}}}|yes|div-col-rules}}" <!--
{{#if:{{{colwidth|}}}{{{gap|}}}{{{style|}}}|
+
-->{{#if:{{{colwidth|}}}{{{gap|}}}{{{style|}}}|<!--
style="{{#if:{{{colwidth|}}}|column-width: {{{colwidth}}};}}{{#if:{{{gap|}}}|column-gap: {{{gap}}};}}{{#if:{{{style|}}}|{{{style}}}}}"
+
-->style="{{#if:{{{colwidth|}}}|column-width: {{{colwidth}}};}}{{#if:{{{gap|}}}|column-gap: {{{gap}}};}}{{#if:{{{style|}}}|{{{style}}}}}"<!--
}}>
+
-->}}><!--
{{#if:{{{content|}}}|{{{content}}}</div>}}
+
-->{{#if:{{{content|}}}|{{{content}}}</div>}}<!-- Inventory how many pages use small=yes  
</includeonly>
+
-->{{#ifeq:{{{small|}}}|yes|[[Category:Pages using div col with small parameter]]}}<!--
<noinclude>
+
--></includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using div col with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Div col]] with unknown parameter "_VALUE_"; use colwidth= to specify column size |ignoreblank=y | colwidth | content | gap | rules | small | style }}<noinclude>
The '''div col''' (short for division columns) formats a list into columns that wrap at multiple screen resolutions responsively. It automatically breaks the available screen space into equal parts, meaning, for instance, that it is not necessary to guess how many columns to use and then figure out the dividing point(s), e.g., the halfway point to divide the list into two columns, or the one-third and two-thirds points to divide the list into three columns.
+
{{Documentation}}
 
 
==This template's parameters==
 
===Descriptions===
 
There are six parameters for this template:
 
: 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., <code>colwidth=20em</code>.
 
: Adds vertical lines ("rules") between the columns if set to <code>yes</code>.
 
: Specifies the space between the content of adjacent columns, in any valid CSS width unit, e.g., <code>gap=2em</code>. The default spacing (set by browser) is 1em.
 
: CSS styling to apply to the columns.
 
: Sets font size to 90%.
 
: Content to apply to the columns.
 
 
 
===Example of "colwidth" parameter===
 
<pre>
 
{{div col|colwidth=10em}} <!-- column width of 10em -->
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{div col end}}
 
</pre>
 
Produces:
 
{{Div col|colwidth=10em}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
===Example of "rules" parameter===
 
<pre>
 
{{Div col|colwidth=10em|rules=yes}} <!-- column width of 10em with rules -->
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
</pre>
 
Produces:
 
{{Div col|colwidth=10em|rules=yes}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
===Example of "gap" parameter===
 
<pre>
 
{{Div col|colwidth=10em|rules=yes|gap=2em}} <!-- column width of 10em with rules and a gap of 2em -->
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
</pre>
 
Produces:
 
{{Div col|colwidth=10em|rules=yes|gap=2em}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
===Example of "small" parameter===
 
<pre>
 
{{Div col|small=yes}} <!-- Small = yes -->
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
</pre>
 
Produces:
 
{{Div col|small=yes}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
===Example of "content" parameter===
 
<pre>
 
{{Div col|colwidth=10em|content= <!-- content parameter doesn't need {{div col end}} -->
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
}}
 
</pre>
 
Produces:
 
{{Div col|colwidth=10em|content=
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
}}
 
 
 
===Usage with multiple parameters===
 
<pre>
 
{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
</pre>
 
Produces:
 
{{Div col|colwidth=10em|rules=yes|gap=2em|small=yes}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
=== Colwidth 20em ===
 
<pre>
 
{{div col|colwidth=20em}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{div col end}}
 
</pre>
 
Produces:
 
{{Div col|colwidth=20em}}
 
* a
 
* b
 
* c
 
* d
 
* e
 
* f
 
* g
 
* h
 
{{Div col end}}
 
 
 
=== Text characters without list markup ===
 
<pre>
 
{{div col|colwidth=10em}} <!--Text characters without list markup -->
 
a
 
b
 
c
 
d
 
e
 
f
 
g
 
h
 
{{div col end}}
 
</pre>
 
Produces
 
{{Div col|colwidth=10em}}
 
a
 
b
 
c
 
d
 
e
 
f
 
g
 
h
 
{{Div col end}}
 
 
 
=== Lorem ipsum ===
 
<pre>
 
{{div col|colwidth=20em}} <!--Lorem ipsum -->
 
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam non congue felis. Ut nisi est, consectetur sit amet risus eu, condimentum efficitur risus. Vestibulum sed consectetur orci. In a elit feugiat, vestibulum lacus sed, finibus nunc. Donec gravida vel magna auctor imperdiet. Ut a bibendum elit, id placerat leo. Cras quis velit dapibus, aliquam ante ac, suscipit nibh. Cras laoreet leo eget elementum lacinia. Vivamus consectetur condimentum velit tincidunt auctor. Sed hendrerit dui vitae tortor volutpat, sit amet tempor libero convallis. Proin a lacinia tellus, eu ullamcorper libero. Maecenas sit amet ligula eu felis tempor faucibus. Quisque ultrices orci euismod metus vulputate, sed viverra urna aliquam.
 
{{div col end}}
 
</pre>
 
Produces
 
{{Div col|colwidth=20em}}
 
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam non congue felis. Ut nisi est, consectetur sit amet risus eu, condimentum efficitur risus. Vestibulum sed consectetur orci. In a elit feugiat, vestibulum lacus sed, finibus nunc. Donec gravida vel magna auctor imperdiet. Ut a bibendum elit, id placerat leo. Cras quis velit dapibus, aliquam ante ac, suscipit nibh. Cras laoreet leo eget elementum lacinia. Vivamus consectetur condimentum velit tincidunt auctor. Sed hendrerit dui vitae tortor volutpat, sit amet tempor libero convallis. Proin a lacinia tellus, eu ullamcorper libero. Maecenas sit amet ligula eu felis tempor faucibus. Quisque ultrices orci euismod metus vulputate, sed viverra urna aliquam.
 
{{Div col end}}
 
 
 
== Limitation ==
 
=== Sub-lists ===
 
The underlying CSS system is unable to break sub-lists into columns. Note the uneven formatting below:
 
 
 
<pre>
 
{{Div col|colwidth=10em|rules=yes|gap=2em|style=column-count:3|content=
 
* a
 
* b
 
* c
 
** c.d
 
** c.e
 
** c.f
 
* g
 
* h
 
}}
 
</pre>
 
Produces:
 
{{Div col|colwidth=10em|rules=yes|gap=2em|style=column-count:3|content=
 
* a
 
* b
 
* c
 
** c.d
 
** c.e
 
** c.f
 
* g
 
* h
 
}}
 
 
</noinclude>
 
</noinclude>

Please note that all contributions to OpenDominion may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenDominion:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Templates used on this page: