Template:Listing/doc: Difference between revisions

From HIBIKIFORUM
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{Support|Template:Div col}}
{{Support|Template:Col list}}
__NOTOC__


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 {{para|colwidth|#}}.
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 {{para|colwidth|#}}.


== Notice ==
== Notice ==
This template uses [[Wikipedia:CSS|CSS]]3 multiple column layout and is not supported by all [[Wikipedia:WWW|Web]] [[Wikipedia:Web browser|browsers]].
This template uses [[Wikipedia:CSS|CSS]]3 multiple column layout and is not supported by all [[Wikipedia:WWW|Web]] [[Wikipedia:Web browser|browsers]].


=== Examples ===
== Usage ==
<div style="float:right;width:50%">
{{tj|Listing
{{Listing|
  | colwidth:
  | List Item 1
  | List Item 2
  | List Item 3
  ...
  | List Item last
}}
 
== Examples ==
<div style="float:right;width:45%">
{{space}}
{{Listing
   | Apple
   | Apple
   | Pear
   | Pear
Line 17: Line 29:
}}</div>
}}</div>


{{Pre|width=25%|{{{{fcb|#4169e1|Listing}}|
{{Pre|width=25%|
{{tj|Listing
   | Apple
   | Apple
   | Pear
   | Pear
Line 27: Line 40:


'''An example using {{para|colwidth}}'''
'''An example using {{para|colwidth}}'''
<div style="float:right;width:50%">
<div style="float:right;width:45%">
{{Listing|colwidth=10|
{{space}}
{{Listing|colwidth = 10
   | Apple
   | Apple
   | Pear
   | Pear
Line 36: Line 50:
}}</div>
}}</div>


{{Pre|width=25%|{{{{fcb|#4169e1|Listing}}|{{fcb|#2e8b57|colwidth}}{{=}}{{font color|#933|10}}|
{{Pre|width=25%|
{{tj|Listing
  | colwidth: 10
   | Apple
   | Apple
   | Pear
   | Pear
Line 42: Line 58:
   | Green Bean
   | Green Bean
   | Corn
   | Corn
}} }}
{{clear}}
'''An example of a list inside a list''' - Must use {{tl|blist}} for inside list.
<div style="float:right;width:50%">
{{space}}
{{Listing|colwidth = 20
  | '''Fruits'''
  {{blist
    | Apple
    | Pear
    | Strawberry
    | Mango
    | Orange }}
  | '''Vegetables'''
  {{blist
    | Cauliflower
    | Broccoli
    | Green Bean
    | Cabbage
    | Acorn squash }}
}}</div>
{{Pre|width=25%|{{{{fcb|#4169e1|Cast listing}}
  | {{fcb|#2e8b57|colwidth}} {{=}} {{fc|#933|20}}
  | {{fc|#933|<nowiki>'''Fruits'''</nowiki>}}
  {{((}}{{fcb|#4169e1|blist}}
    | {{fc|#933|Apple}}
    | {{fc|#933|Pear}}
    | {{fc|#933|Strawberry}}
    | {{fc|#933|Mango}}
    | {{fc|#933|Orange}} {{))}}
  | {{fc|#933|<nowiki>'''Vegetables'''</nowiki>}}
  {{((}}{{fcb|#4169e1|blist}}
    | {{fc|#933|Cauliflower}}
    | {{fc|#933|Broccoli}}
    | {{fc|#933|Green Bean}}
    | {{fc|#933|Cabbage}}
    | {{fc|#933|Acorn squash}} {{))}}
}} }}
}} }}


Line 64: Line 119:


<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
[[Category:Templates]]
[[Category:List templates]]
[[Category:General Use Templates]]
[[Category:General use templates]]
}}}}</includeonly>
}}}}</includeonly>

Latest revision as of 02:36, 20 August 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.

Usage

{{Listing
| colwidth =
| List Item 1
| List Item 2
| List Item 3 ...
| List Item last
}}

Examples

 

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

An example using |colwidth=

 

  • Apple
  • Pear
  • Tomato
  • Green Bean
  • Corn
{{Listing
| colwidth = 10
| Apple
| Pear
| Tomato
| Green Bean
| Corn
}}

An example of a list inside a list - Must use {{blist}} for inside list.

 

  • Fruits
    • Apple
    • Pear
    • Strawberry
    • Mango
    • Orange
  • Vegetables
    • Cauliflower
    • Broccoli
    • Green Bean
    • Cabbage
    • Acorn squash
{{Cast listing
  | colwidth = 20
  | '''Fruits'''
  {{blist
    | Apple
    | Pear
    | Strawberry
    | Mango
    | Orange }}
  | '''Vegetables'''
  {{blist
    | Cauliflower
    | Broccoli
    | Green Bean
    | Cabbage
    | Acorn squash }}
}}

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