Template:Listing/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 9: Line 9:
=== Examples ===
=== Examples ===
Here is an example:
Here is an example:
<pre>
{{Pre|{{((}}{{fcb|#4169e1|Listing}}|
{{Listing|
* Apple
* Apple
* Pear
* Pear
Line 16: Line 15:
* Green Bean
* Green Bean
* Corn
* Corn
}}
{{))}} }}
</pre>


which would render as:
which would render as:
Line 29: Line 27:


An example using {{para|colwidth}}
An example using {{para|colwidth}}
<pre>
{{Pre|{{((}}{{fcb|#4169e1|Listing}}|{{fcb|#2e8b57|colwidth}}{{=}}{{font color|#933|15}}|
{{Listing|colwidth=15|
* Apple
* Apple
* Pear
* Pear
Line 47: Line 44:
* Corn
* Corn
}}
}}
== TemplateData ==
<templatedata>
{
"description": "Formats a list into columns that automatically space for the given screen size.",
"params": {
"colwidth": {
"label": "Column Width",
"description": "To increase the width of the columns manually, so as to avoid names from breaking into multiple lines.",
"type": "number",
"default": "30",
"required": false
}
}
}
</templatedata>


<includeonly>{{sandbox other||{{testcases other||
<includeonly>{{sandbox other||{{testcases other||

Revision as of 02:58, 18 June 2023

Light bulb.png }}
It contains usage information, categories and other content that is not part of the original template page.

This template is used to create a multiple column list. 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. The default value for the column width is 30em, to change this value use |colwidth=#.

Notice

This template uses CSS3 multiple column layout and is not supported by all Web browsers.

Examples

Here is an example:

{{Listing|
* Apple
* Pear
* Tomato
* Green Bean
* Corn
}}

which would render as:

    • Apple
    • Pear
    • Tomato
    • Green Bean
    • Corn

An example using |colwidth=

{{Listing|colwidth=15|
* Apple
* Pear
* Tomato
* Green Bean
* Corn

which would render as:

    • Apple
    • Pear
    • Tomato
    • Green Bean
    • Corn

TemplateData

Formats a list into columns that automatically space for the given screen size.

Template parameters

ParameterDescriptionTypeStatus
Column Widthcolwidth

To increase the width of the columns manually, so as to avoid names from breaking into multiple lines.

Default
30
Numberoptional