Pengguna:RianHS/Alat 2

Revisi sejak 4 November 2020 07.41 oleh RianHS (bicara | kontrib) (←Membuat halaman berisi '__NOTOC__ __HIDDENCAT__ == Templat navigasi == <div style="height: 500px; width: 100%; overflow: auto; padding: 3px;text-align: left; border:1px solid black;" title="...')
(beda) ← Revisi sebelumnya | Revisi terkini (beda) | Revisi selanjutnya → (beda)


Templat navigasi

Navbox

Usage

Please remove the parameters that are left blank.

{{Navbox
|name    = {{subst:PAGENAME}}
|title   = 
|image   = 
|above   = 

|group1  = 
|list1   = 

|group2  = 
|list2   = 
 ...
|group20 = 
|list20  = 

|below   = 
}}

Parameter list

The navbox uses lowercase parameter names, as shown in the box (at right). The mandatory name and title will create a one-line box if other parameters are omitted.

Notice "group1" (etc.) is optional, as are sections named "above/below".

The basic and most common parameters are as follows (see below for the full list):

name - the name of the template.
title - text in the title bar, such as: [[Widget stuff]].
state - autocollapse, uncollapsed, collapsed: the status of box expansion, where "autocollapse" hides stacked navboxes automatically.
titlestyle - a CSS style for the title-bar, such as: background:gray;
groupstyle - a CSS style for the group-cells, such as: background:#eee;
image - an optional right-side image (coded as the whole image tag: [[Image:XX.jpg|90px]] ).
imageleft - an optional left-side image (code the same was as the "image" parameter).
above - text to appear above the group/list section (could be a list of overall wikilinks).
groupn - the left-side text before list-n (if group-n omitted, list-n starts at left of box).
listn - text listing wikilinks, often separated by middot templates, such as: [[A]]{{·}} [[B]]
below - optional text to appear below the group/list section.

Further details, and complex restrictions, are explained below under section Parameter descriptions. See some alternate navbox formats under: Layout of table.

Parameter descriptions

The following is a complete list of parameters for using {{Navbox}}. In most cases, the only required parameters are name, title, and list1, though child navboxes do not even require those to be set.

{{Navbox}} shares numerous common parameter names as its sister templates {{Navbox with columns}} and {{Navbox with collapsible groups}} for consistency and ease of use. Parameters marked with a cross are common to all three master templates.

Setup parameters

name
The name of the template, which is needed for the "v · d · e" ("view · discuss · edit") links to work properly on all pages where the template is used. You can enter {{subst:PAGENAME}} for this value as a shortcut. The name parameter is only mandatory if a title is specified, and the border parameter is not set.
state [autocollapse, uncollapsed, collapsed, plain, off]
  • Defaults to autocollapse. A navbox with autocollapse will start out collapsed if there are two or more tables on the same page that use other collapsible tables. Otherwise, the navbox will be expanded. For the technically minded, see MediaWiki:Common.js.
  • If set to collapsed, the navbox will always start out in a collapsed state.
  • If set to plain, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered (by using padding to offset the v • d • e links).
  • If set to off, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered. This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden.
  • If set to anything other than autocollapse, collapsed, plain, or off (such as "uncollapsed"), the navbox will always start out in an expanded state, but have the "hide" button.
To show the box when standalone (non-included) but then auto-hide contents when in an article, put "uncollapsed" inside <noinclude> tags:
  • state = <noinclude>uncollapsed</noinclude>
  • That setting will force the box visible when standalone (even when followed by other boxes), displaying "[hide]" but then auto-collapse the box when stacked inside an article.
Often times, editors will want a default initial state for a navbox, which may be overridden in an article. Here is the trick to do this:
  • In your intermediate template, create a parameter also named "state" as a pass-through like this:
  • | state = {{{state<includeonly>|your_desired_initial_state</includeonly>}}}
  • The <includeonly>| will make the template expanded when viewing the template page by itself.
  • Example: {{peso}} with autocollapse as the default initial state. Bolivian peso transcludes it and has only one navbox. So the peso navbox shows. Chilean peso has two navboxes. So the peso navbox collapses.
  • Example: {{Historical currencies of Hungary}} with expanded as the default initial state. All transcluding articles shows the content by default, unless there were an hypothetical article that specifies state = collapsed when transcluding.
navbar
Defaults to Tnavbar. If set to plain, the v • d • e links on the left side of the titlebar will not be displayed, and padding will be automatically used to keep the title centered. Use off to remove the v • d • e links, but not apply padding (this is for advanced use only; the "plain" option should suffice for most applications where a navbar is not desired). Note that it is highly recommended that one does not hide the navbar, in order to make it easier for users to edit the template, and to keep a standard style across pages.
border
See section below on using navboxes within one another for examples and a more complete description. If set to child or subgroup, then the navbox can be used as a borderless child that fits snuggly in another navbox. The border is hidden and there is no padding on the sides of the table, so it fits into the list area of its parent navbox. If set to none, then the border is hidden and padding is removed, and the navbox may be used as a child of another container (do not use the none option inside of another navbox; similarly, only use the child/subgroup option inside of another navbox). If set to anything else (default), then a regular navbox is displayed with a 1px border. An alternate way to specify the border to be a subgroup style is like this (i.e. use the first unnamed parameter instead of the named border parameter):
{{Navbox|child
...
}}

Cells

title
Text that appears centered in the top row of the table. It is usually the template's topic, i.e. a succinct description of the body contents. This should be a single line, but if a second line is needed, use {{-}} to ensure proper centering. This parameter is technically not mandatory, but using {{Navbox}} is rather pointless without a title.
groupn
(i.e. group1, group2, etc.) If specified, text appears in a header cell displayed to the left of listn. If omitted, listn uses the full width of the table.
listn
(i.e. list1, list2, etc.) The body of the template, usually a list of links. Format is inline, although the text can be entered on separate lines if the entire list is enclosed within <div> </div>. At least one list parameter is required; each additional list is displayed in a separate row of the table. Each listn may be preceded by a corresponding groupn parameter, if provided (see below).
image
An image to be displayed in a cell below the title and to the right of the body (the groups/lists). For the image to display properly, the list1 parameter must be specified. The image parameter accepts standard wikicode for displaying an image, i.e.
image = [[Image:Example.jpg|100px]]
imageleft
An image to be displayed in a cell below the title and to the left of the body (lists). For the image to display properly, the list1 parameter must be specified and no groups can be specified. The imageleft parameter accepts standard wikicode for displaying an image, i.e.
imageleft = [[Image:Example.jpg|100px]]
above
A full-width cell displayed between the titlebar and first group/list, i.e. above the template's body (groups, lists and image). In a template without an image, above behaves in the same way as the list1 parameter without the group1 parameter.
below
A full-width cell displayed below the template's body (groups, lists and image). In a template without an image, below behaves in the same way as the template's final listn parameter without a groupn parameter. For an example of the below parameter in use, see {{Lists of the provinces and territories of Canada}}.

Style parameters

Styles are generally not recommended as to maintain consistency among templates and pages in Wikipedia. However, the option to modify styles is given.

style
Specifies CSS styles to apply to the template body. The parameter bodystyle also does the example same thing and can be used in place of this style parameter. This option should be used sparingly as it can lead to visual inconsistencies. Examples:
style = background:#nnnnnn;
style = width:N [em/%/px or width:auto];
style = float:[left/right/none];
style = clear:[right/left/both/none];
basestyle
CSS styles to apply to the title, above, below, and group cells all at once. The style are not applied to list cells. This is convenient for easily changing the basic color of the navbox without having to repeat the style specifications for the different parts of the navbox. Examples:
basestyle = background:lightskyblue;
titlestyle
CSS styles to apply to title, most often the titlebar's background color:
titlestyle = background:#nnnnnn;
titlestyle = background:name;
groupstyle
CSS styles to apply to the groupN cells. This option overrides any styles that are applied to the entire table. Examples:
groupstyle = background:#nnnnnn;
groupstyle = text-align:[left/center/right];
groupstyle = vertical-align:[top/middle/bottom];
groupnstyle
CSS styles to apply to a specific group, in addition to any styles specified by the groupstyle parameter. This parameter should only be used when absolutely necessary in order to maintain standardization and simplicity. Examples:
group3style = background:red;color:white;
liststyle
CSS styles to apply to all lists. Overruled by the oddstyle and evenstyle parameters (if specified) below.
listnstyle
CSS styles to apply to a specific group, in addition to any styles specified by the groupstyle parameter. This parameter should only be used when absolutely necessary in order to maintain standardization and simplicity. Examples:
list5style = background:#ddddff;
listpadding
A number and unit specifying the padding in each list cell. The list cells come equipped with a default padding of 0.25em on the left and right, and 0em on the top and bottom. Due to complex technical reasons, simply setting "liststyle=padding:0.5em;" (or any other padding setting) will not work. Examples:
listpadding = 0.5em 0em; (sets 0.5em padding for the left/right, and 0em padding for the top/bottom.)
listpadding = 0em; (removes all list padding.)
oddstyle
evenstyle
Applies to odd/even list numbers. Overrules styles defined by liststyle. The default behavior is to add striped colors (white and gray) to odd/even rows, respectively, in order to improve readability. These should not be changed except in extraordinary circumstances.
evenodd [swap, even, odd, off]
If set to swap, then the automatic striping of even and odd rows is reversed. Normally, even rows get a light gray background for striping; when this parameter is used, the odd rows receive the gray striping instead of the even rows. Setting to even or odd sets all rows to have that striping color. Setting to off disables automatic row striping. This advanced parameter should only be used to fix problems when the navbox is being used as a child of another navbox and the stripes do not match up. Examples and a further description can be found in the section on child navboxes below.
abovestyle
belowstyle
CSS styles to apply to the top cell (specified via the above parameter) and bottom cell (specified via the below parameter). Typically used to set background color or text alignment:
abovestyle = background:#nnnnnn;
abovestyle = text-align:[left/center/right];
imagestyle
imageleftstyle
CSS styles to apply to the cells where the image/imageleft sits. These styles should only be used in exceptional circumstances, usually to fix width problems if the width of groups is set and the width of the image cell grows too large. Examples:
imagestyle = width:5em;
Default styles

The style settings listed here are those that editors using the navbox change most often. The other more complex style settings were left out of this list to keep it simple. Most styles are set in MediaWiki:Common.css.

bodystyle = background:#fdfdfd; width:100%; vertical-align:middle;
titlestyle = background:#ccccff; padding-left:1em; padding-right:1em; text-align:center;
abovestyle = background:#ddddff; padding-left:1em; padding-right:1em; text-align:center;
belowstyle = background:#ddddff; padding-left:1em; padding-right:1em; text-align:center;
groupstyle = background:#ddddff; padding-left:1em; padding-right:1em; text-align:right;
liststyle = background:transparent; text-align:left/center;
oddstyle = background:transparent;
evenstyle = background:#f7f7f7;

Since liststyle and oddstyle are transparent odd lists have the color of the bodystyle, which defaults to #fdfdfd (white with a hint of gray). A list has text-align:left; if it has a group, if not it has text-align:center;. Since only bodystyle has a vertical-align all the others inherit its vertical-align:middle;.


Advanced parameters

titlegroup
This puts a group in the title area, with the same default styles as groupn. It should be used only in exceptional circumstances (usually advanced meta-templates) and its use requires some knowledge of the internal code of {{Navbox}}; you should be ready to manually set up CSS styles to get everything to work properly if you wish to use it. If you think you have an application for this parameter, it might be best to change your mind, or consult the talk page first.
titlegroupstyle
The styles for the titlegroup cell.
innerstyle
A very advanced parameter to be used only for advanced meta-templates employing the navbox. Internally, the navbox uses an outer table to draw the border, and then an inner table for everything else (title/above/groups/lists/below/images, etc.). The style/bodystyle parameter sets the style for the outer table, which the inner table inherits, but in advanced cases (meta-templates) it may be necessary to directly set the style for the inner table. This parameter provides access to that inner table so styles can be applied. Use at your own risk.

Layout of table

Table generated by {{Navbox}} without image, above and below parameters (gray list background color added for illustration only):


Table generated by {{Navbox}} with image, above and below parameters (gray list background color added for illustration only):


Table generated by {{Navbox}} with image, imageleft, lists, and without groups, above, below (gray list background color added for illustration only):

Examples

No image

{{Navbox
|name  = Navbox/doc
|title = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]]{{-}}''without image''

|group1 = Centre
|list1  = [[Cyberjaya]]

|group2 = Area
|list2  = [[Klang Valley]]

|group3 = Major landmarks
|list3  = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}} [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}} 
[[Kuala Lumpur International Airport]]

|group4 = Infrastructure
|list4  = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]]

|group5 = Prime applications
|list5  = [[EGovernment]]{{·}} [[MyKad]]  
}}


With image, without groups

{{Navbox
|name  = Navbox/doc
|title = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]]
|image = [[Image:Flag of Malaysia.svg|80px]]
|list1 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}} [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}} [[Kuala Lumpur International Airport]]
}}


With two images, without groups, multiple lists

{{Navbox
|name  = Navbox/doc
|title = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]]
|image = [[Image:Flag of Malaysia.svg|80px]]
|imageleft = [[Image:Flag of Malaysia.svg|80px]]
|list1 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]
|list2 = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]]
|list3 = [[EGovernment]]{{·}} [[MyKad]]
|list4 = [[Klang Valley]]
}}


With image, groups, above, below

{{Navbox
|name  = Navbox/doc
|title = [[Multimedia Super Corridor|MSC (Multimedia Super Corridor) Malaysia]]
|image = [[Image:Flag of Malaysia.svg|80px]]

|above = Above text goes here

|group1 = Centre
|list1  = [[Cyberjaya]]

|group2 = Area
|list2  = [[Klang Valley]]

|group3 = Major landmarks
|list3  = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}} [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}} [[Kuala Lumpur International Airport]]

|group4 = Infrastructure
|list4  = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]]

|group5 = Prime applications
|list5  = [[EGovernment]]{{·}} [[MyKad]]

|below  = Website: [http://www.msc.com.my/ www.msc.com.my]
}}


Child navboxes

It is possible to place multiple navboxes within a single border with the use of the border parameter, or by specifying the first parameter to be "child". The basic code for doing this is as follows (which adds a subgroup for the first group/list area):

{{Navbox
|name = {{subst:PAGENAME}}
|title = Title

|group1 = [optional]
|list1 = {{Navbox|child
   ...child navbox parameters...
 }}

...
}}

Subgroups example

This example shows how subgroups can be used. It is recommended that one uses {{Navbox subgroup}}, but the same result can be reached by using {{Navbox}} with border = child or the first unnamed parameter set to child. Note that the evenodd parameter is used to reverse striping in some of the subgroups in order to get all of the stripes to line up properly. If you wish to remove the striping altogether, you can set liststyle = background:transparent; in each of the navboxes.

Multiple show/hides in a single container

The example below is generated using a regular navbox for the main container, then its list1, list2, and list3 parameters each contain another navbox, with border = child set. Note that each of the child navboxes has its own VDE navbar; these could be hidden using navbar = plain for each of them, or by just leaving out the name parameter (child navboxes do not require the name parameter to be set, unlike regular navboxes).

Additional examples

You may find additional examples of complex subgroups and child navboxes at the advanced navbox examples page and the Navbox code test page.

Relationship with other Navbox templates

This navbox template is specifically designed to work in conjunction two other sister templates: {{Navbox with columns}} and {{Navbox with collapsible groups}}. All three of these templates share common parameters for consistency and ease of use (such parameters are marked with a in the complete parameter list above). Most importantly, all three of these templates can each be used as children of one another (by using the border = child parameter, or by specifying the first unnamed parameter to be child (i.e. use {{Navbox|child, {{Navbox with columns|child, or {{Navbox with collapsible groups|child). For examples on how this is done, see the page on advanced navbox examples.

Technical details

  • This template uses CSS classes for most of its looks, thus it is fully skinnable.
  • Internally this meta template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta templates since wiki markup has several drawbacks. For instance it makes it harder to use parser functions and special characters in parameters.

Intricacies

  • The 2px wide border between groups and lists is drawn using the border-left property of the list cell. Thus, if you wish to change the background color of the template (for example bodystyle = background:purple;), then you'll need to make the border-left-color match the background color (i.e. liststyle = border-left-color:purple;). If you wish to have a border around each list cell, then the 2px border between the list cells and group cells will disappear; you'll have to come up with your own solution.
  • The list cell width is initially set to 100%. Thus, if you wish to manually set the width of group cells, you'll need to also specify the liststyle to have width:auto. If you wish to set the group width and use images, it's up to you to figure out the CSS in the groupstyle, liststyle, imagestyle, and imageleftstyle parameters to get everything to work correctly. Example of setting group width:
groupstyle = width:10em;
liststyle = width:auto;
  • Adjacent navboxes have only a 1 pixel border between them (except in IE6, which doesn't support the necessary CSS). If you set the top or bottom margin of style/bodystyle, then this will not work.
  • The default margin-left and margin-right of the outer navbox table are set to "auto;". If you wish to use navbox as a float, you need to manually set the margin-left and margin-right values, because the auto margins interfere with the float option. For example, add the following code to use the navbox as a float:
style = width:22em;float:right;margin-left:1em;margin-right:0em;

See also

  • {{Navbox with columns}} – Allows columns instead of groups/lists
  • {{Navbox with collapsible groups}} – Another variation.
  • Wikipedia:Line break handling – The how-to guide about how to handle word wraps (line breaks) on Wikipedia, such as the wrapping of the link lists used in navboxes.
  • {{Nowrap begin}} – The recommended format for adding bullets, pipes, or dashes between list items. The page describes how to go about using them with proper wrapping.
  • {{Nobold}} – To display text at normal font-weight within a context where the default font-weight is bold, e.g. header cells in tables.
  • {{·}} and {{•}} – The dot and bullet commonly used to separate items in Navbox lists.

Navbox with columns

Basic syntax

Only required parameters and colwidth included.

{{Navbox with columns
|name  = {{subst:PAGENAME}}
|title = 
|colwidth =  <!--(to set a default width for each column,
                  preferably in a proportional unit such as 'em'*)-->
|col1  = 
|col2  = 
}}
* See Em (typography). Using proportional units means the template should still be displayed correctly across a range of browser font-sizes. If colwidth not specified, a default 10em is used.

Parameters

Required parameters in bold. Parameters marked with a cross are parameters in common with the sister templates {{Navbox}} and {{Navbox with collapsible groups}}. A much more complete description of those parameters is available at {{Navbox}}.

Setup parameters

name
The name of the template. The name of this template, for example, is "Navbox with columns".
state
Possible values are collapsed, uncollapsed, plain, off, and the default autocollapse. See {{Navbox}} for more information.
navbar
Possible values are plain, off, and the default value of blank. See {{Navbox}} for more information.
border
Possible values are child, none, and the default value of blank. Set to child if you wish to use the navbox inside of another navbox; with this option, the child navbox is borderless and fits snuggly inside of its parent navbox. The parent navbox may be the list area of {{Navbox}}, a columns of another {{Navbox with columns}}, or a section of {{Navbox with collapsible groups}}. See {{Navbox}} for more information and examples.

Basic data parameters

title
The title of the template, displayed centered in the titlebar at the top of the template.
above
Text or other elements to appear above the columns.
image
Image to the right of all of the columns.
imageleft
Image to the left of all of the columns.
below
Text or other elements to appear below the columns.

Style parameters

bodystyle
CSS style/s to apply to the template's body (i.e. including space not used by columns)
titlestyle
CSS style/s to apply to titlebar; usually background:color (background defaults to NavHead default).
abovestyle
belowstyle
CSS style/s to apply to the above and below parameters, respectively.
basestyle
CSS style/s to apply to the title, above, and below, parameters, all at the same time.
imagestyle
CSS style/s to apply to the image parameter.
imageleftstyle
CSS style/s to apply to the imageleft parameter
colstyle
CSS style/s to apply across all columns; if used, usually background:color per titlestyle above.
oddcolstyle
evencolstyle
CSS style/s to apply to all odd/even-numbered columns, respectively.
colnstyle
CSS style/s to apply to the nth column only.
colheaderstyle
CSS style/s to apply to all column headers.
colnheaderstyle
CSS style/s to apply to the nth column header.
colnfooterstyle
CSS style/s to apply to the nth column footer cell.

Columns parameters

colwidth
Width, preferably in a proportional unit such as 'em', or as a percentage, used for each column whose width not specified by colNwidth below. Defaults to 10em. Examples:
colwidth = 15em
colwidth = 25%
fullwidth
If set to anything, then the total width of the columns are scaled linearly to make the sum of the widths 100%. A rather advanced parameter, this usually need not be used and should be left blank. If a colheader or colfooter is used, then fullwidth is used automatically. Example:
fullwidth = true
padding
Padding before first column, preferably in a proportional unit. Defaults to 5em. Padding is disabled by setting it to 0 (or 0em, or 0%).
colnwidth
The nth column's width (overrides colwidth above).
coln
The content of the nth column. If any columns are used, then col1 is required. There can be a maximum of 20 columns.
colnheader
A header cell for the nth column that appears above the column. See below for examples.
colnfooter
A footer cell that appears below the nth column.
colnheadercolspan
A number specifying how many columns the nth column header should span. It defaults to 1. If it is greater than one, then do not specify column headers that it covers. For example, if col1headercolspan = 3, then leave col2header and col3header blank.
colnfootercolspan
A number specifying how many columns the nth column footer should span. It defaults to 1. If it is greater than one, then do not specify column footers that it covers. For example, if col1footercolspan = 3, then leave col2footer and col3footer blank.

Additional groups/lists

You may wish to add a few extra groups and/or lists below the columns. The following parameters are given to provide such functionality. See {{Navbox}} for a more complete description of how they work, and for more examples.

groupn
Allows up to 6 additional groups to go along with the lists below the columns.
listn
Allows up to 6 additional lists below the columns.
groupstyle
The general CSS style/s for the groups.
groupnstyle
CSS style/s for the nth group parameter.
liststyle
The general CSS style/s for the lists.
listnstyle
CSS style/s for the nth list parameter.
listpadding
Amount of padding to have in each list cell.
oddstyle
evenstyle
Applies to odd/even list numbers. Overrules styles defined by liststyle. The default behavior is to add striped colors (white and gray) to odd/even rows, respectively, in order to improve readability. These should not be changed except in extraordinary circumstances.
evenodd [swap, even, odd, off]
See {{Navbox}} for description.

Examples

Basic example

{{Navbox with columns
|name    = East Asia Summit (EAS)
|title   = Member states of the [[East Asia Summit|East Asia Summit (EAS)]]
|width   = 18.25em
|padding = 10em

|above = ''This is where the {{{above}}} would appear.''

|col1 = {{AUS}}<br/> {{BRU}}<br/> {{CAM}}<br/> {{IND}}
|col2 = {{IDN}}<br/> {{JPN}}<br/> {{LAO}}<br/> {{MAS}}
|col3 = {{MYA}}<br/> {{NZL}}<br/> {{CHN-PRC}}<br/> {{PHI}}
|col4width=17em
|col4 = {{SIN}}<br/> {{KOR}}<br/> {{THA}}<br/> {{VIE}}

|below = '''Potential future members'''{{spaces|6}}{{TLS}}{{spaces|3}}{{RUS}}
}}


Example with percentage widths

{{Navbox with columns
| name = Plastics
| title = [[Plastic]]s
| colwidth = 33%
| colstyle = text-align: center
| col1 = [[Polyethylene]] (PE)<br />[[Polyethylene terephthalate]] (PET or PETE)<br />[[Polyvinyl chloride]] (PVC)<br />[[Polyvinylidene chloride]] (PVDC)<br />[[Polylactic acid]] (PLA)
| col2 = [[Polypropylene]] (PP)<br />[[Polyamide]] (PA)<br />[[Polycarbonate]] (PC)<br />[[Polytetrafluoroethylene]] (PTFE)<br />[[Polyurethane]] (PU)
| col3 = [[Polystyrene]] (PS)<br /> [[Polyester]]<br /> [[Acrylonitrile butadiene styrene]] (ABS)<br /> [[Acrylic glass|Polymethyl methacrylate]] (PMMA)<br /> [[Polyoxymethylene]] (POM)
}}


Example with colnheader and colnfooter

The gray background for the columns is added for illustration only.


Example with colnheader using colnheadercolspan

The gray background for the columns is added for illustration only. This example shows the colnheadercolspan parameter being used, but you may also use colnfootercolspan to adjust the span of the footer cells.


Example to illustrate most fields

The gray background and centered text for the columns is for illustration only. The columns default to an off-white background and left text alignment. This example shows how you can use up to six additional groups/lists after the columns.

Using child navboxes

All three types of navbox templates, namely {{Navbox}}, {{Navbox with columns}}, and {{Navbox with collapsible groups}}, can be nested inside of one another using the border parameter (which is common to all three). For complex templates, it may be necessary to use nesting to achieve a desired look.

Nesting Navbox with columns in itself

This example shows how one can nest multiple {{Navbox with columns}} templates to get the right look. Edit this section to view the code. There is a main {{Navbox with columns}} and two additional {{Navbox with columns}} templates, with the "child" option set (see code).

Nesting other Navbox forms

This example shows {{Navbox}}, {{Navbox with collapsible groups}} and {{Navbox with columns}} all working together. Press the edit button for the section to view the code. Note that each of the child navboxes has the first parameter set to child

See also


Navbox subgroup

Contoh

Contoh 1

Berikut ini adalag contoh Navbox subgroup yang digunakan dengan templat Navbox.

{{Navbox
| name   = Protected Areas of Colorado
| title  = Protected Areas of Colorado
| group1 = National Park Service
| list1  = 
  {{Navbox subgroup
   |group1 = National Parks
   |list1  = [[Black Canyon of the Gunnison National Park|Black Canyon of the Gunnison]]{{•}} [[Great Sand Dunes National Park and Preserve|Great Sand Dunes]]{{•}} [[Mesa Verde National Park|Mesa Verde]]{{•}} [[Rocky Mountain National Park|Rocky Mountain]]
   |group2 = National Monuments
   |list2  = [[Colorado National Monument|Colorado]]{{•}} [[Florissant Fossil Beds National Monument|Florissant Fossil Beds]]{{•}} [[Hovenweep National Monument|Hovenweep]]{{•}} [[Yucca House National Monument|Yucca House]]
   |group3 = National Historic Sites
   |list3  = [[Bent's Old Fort National Historic Site|Bent's Old Fort]]{{•}} [[Sand Creek Massacre National Historic Site|Sand Creek Massacre]]
   |group4 = National Recreation Area
   |list4  = [[Curecanti National Recreation Area|Curecanti]]
  }}
| group2 = National Forests
| list2  = [[Arapaho National Forest|Arapaho]]{{•}} [[Grand Mesa National Forest|Grand Mesa]]{{•}} [[Gunnison National Forest|Gunnison]]{{•}} [[Pike National Forest|Pike]]{{•}} [[Rio Grande National Forest|Rio Grande]]{{•}} [[Roosevelt National Forest|Roosevelt]]{{•}} [[Medicine Bow - Routt National Forest|Medicine Bow - Routt]]{{•}} [[San Isabel National Forest|San Isabel]]{{•}} [[San Juan National Forest|San Juan]]{{•}} [[Uncompahgre National Forest|Uncompahgre]]{{•}} [[White River National Forest|White River]]
}}

Contoh 2

{{Navbox
| name  = Roman Emperors
| title = Roman Emperors
| group1 = Crisis 235 AD - 284 AD
| list1  = [[Maximinus Thrax]]{{·}} [[Gordian I]]{{·}} [[Gordian II]]{{·}} [[Pupienus]] and [[Balbinus]]{{·}} [[Gordian III]]{{·}} [[Philip the Arab]]{{·}} [[Decius]]{{·}} [[Trebonianus Gallus]]{{·}} [[Aemilianus]]{{·}} [[Valerian (emperor)|Valerian]]{{·}} [[Gallienus]]{{·}} [[Claudius II]]{{·}} [[Quintillus]]{{·}} [[Aurelian]]{{·}} [[Marcus Claudius Tacitus]]{{·}} [[Florianus]]{{·}} [[Probus]]{{·}} [[Carus]]{{·}} [[Numerian]]{{·}} [[Carinus]]
| group2 = Dominate
| list2  = 
  {{Navbox subgroup
   |list1style = background:#ddf;
   |list1 = '''284 AD - 395 AD'''
   |list2 = [[Diocletian]]{{·}} [[Maximian]]{{·}} [[Constantius Chlorus|Constantius I]]{{·}} [[Galerius]]{{·}} [[Flavius Valerius Severus|Severus II]]{{·}} [[Maxentius]]{{·}} [[Maximinus]]{{·}} [[Licinius]]{{·}} [[Constantine I]]{{·}} [[Constantine II (emperor)|Constantine II]]{{·}} [[Constans|Constans I]]{{·}} [[Constantius II]]{{·}} [[Julian the Apostate]]{{·}} [[Jovian]]{{·}} [[Valentinian I]]{{·}} [[Valens]]{{·}} [[Gratian]]{{·}} [[Valentinian II]]{{·}} [[Eugenius]]{{·}} [[Theodosius I]]
   |list3style = background:#ddf;
   |list3 = '''Western Empire (393 AD - 476 AD)'''
   |list4 = [[Honorius (emperor)|Honorius]]{{·}} [[Constantius III]]{{·}} [[Joannes]]{{·}} [[Valentinian III]]{{·}} [[Petronius Maximus]]{{·}} [[Avitus]]{{·}} [[Majorian]]{{·}} [[Libius Severus]]{{·}} [[Anthemius]]{{·}} [[Olybrius]]{{·}} [[Glycerius]]{{·}} [[Julius Nepos]]{{·}} [[Romulus Augustus]]
  }}
}}

Navbox with collapsible groups

kode:

{{Navbox
|name = {{{name|<noinclude>Navbox with collapsible sections</noinclude>}}}
|navbar = {{{navbar|}}}
|state = {{{state<noinclude>|uncollapsed</noinclude>}}}
|border = {{{border|{{{1|}}}}}}

|title = {{{title<includeonly>|</includeonly>}}}
|above = {{{above|}}}
|below = {{{below|}}}
|image = {{{image|}}}
|imageleft = {{{imageleft|}}}

|style = {{{style|}}}{{{bodystyle|}}}
|basestyle = {{{basestyle|}}}
|titlestyle = {{{titlestyle|}}}
|abovestyle = {{{abovestyle|}}}
|belowstyle = {{{belowstyle|}}}
|imagestyle = {{{imagestyle|}}}
|imageleftstyle = {{{imageleftstyle|}}}

|list1 =
{{#if:{{{group1<includeonly>|</includeonly>}}}{{{sect1|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr1}}} |uncollapsed |{{{state1|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group1style|}}}
    |liststyle  = {{{liststyle|}}}{{{list1style|}}}
    |title = {{{group1<includeonly>|</includeonly>}}}{{{sect1|}}}
    |list1 = {{{list1<includeonly>|</includeonly>}}}
    |image = {{{image1|}}}
    |imageleft = {{{imageleft1|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list1|}}}
}}

|list2 =
{{#if:{{{group2<includeonly>|</includeonly>}}}{{{sect2|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr2}}} |uncollapsed |{{{state2|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group2style|}}}
    |liststyle  = {{{liststyle|}}}{{{list2style|}}}
    |title = {{{group2<includeonly>|</includeonly>}}}{{{sect2|}}}
    |list1 = {{{list2<includeonly>|</includeonly>}}}
    |image = {{{image2|}}}
    |imageleft = {{{imageleft2|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list2|}}}
}}

|list3 =
{{#if:{{{group3<includeonly>|</includeonly>}}}{{{sect3|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr3}}} |uncollapsed |{{{state3|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group3style|}}}
    |liststyle  = {{{liststyle|}}}{{{list3style|}}}
    |title = {{{group3<includeonly>|</includeonly>}}}{{{sect3|}}}
    |list1 = {{{list3<includeonly>|</includeonly>}}}
    |image = {{{image3|}}}
    |imageleft = {{{imageleft3|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list3|}}}
}}

|list4 =
{{#if:{{{group4<includeonly>|</includeonly>}}}{{{sect4|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr4}}} |uncollapsed |{{{state4|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group4style|}}}
    |liststyle  = {{{liststyle|}}}{{{list4style|}}}
    |title = {{{group4<includeonly>|</includeonly>}}}{{{sect4|}}}
    |list1 = {{{list4<includeonly>|</includeonly>}}}
    |image = {{{image4|}}}
    |imageleft = {{{imageleft4|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list4|}}}
}}

|list5 =
{{#if:{{{group5|}}}{{{sect5|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr5}}} |uncollapsed |{{{state5|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group5style|}}}
    |liststyle  = {{{liststyle|}}}{{{list5style|}}}
    |title = {{{group5<includeonly>|</includeonly>}}}{{{sect5|}}}
    |list1 = {{{list5<includeonly>|</includeonly>}}}
    |image = {{{image5|}}}
    |imageleft = {{{imageleft5|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list5|}}}
}}

|list6 =
{{#if:{{{group6|}}}{{{sect6|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr6}}} |uncollapsed |{{{state6|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group6style|}}}
    |liststyle  = {{{liststyle|}}}{{{list6style|}}}
    |title = {{{group6<includeonly>|</includeonly>}}}{{{sect6|}}}
    |list1 = {{{list6<includeonly>|</includeonly>}}}
    |image = {{{image6|}}}
    |imageleft = {{{imageleft6|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list6|}}}
}}

|list7 =
{{#if:{{{group7|}}}{{{sect7|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr7}}} |uncollapsed |{{{state7|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group7style|}}}
    |liststyle  = {{{liststyle|}}}{{{list7style|}}}
    |title = {{{group7<includeonly>|</includeonly>}}}{{{sect7|}}}
    |list1 = {{{list7<includeonly>|</includeonly>}}}
    |image = {{{image7|}}}
    |imageleft = {{{imageleft7|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list7|}}}
}}

|list8 =
{{#if:{{{group8|}}}{{{sect8|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr8}}} |uncollapsed |{{{state8|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group8style|}}}
    |liststyle  = {{{liststyle|}}}{{{list8style|}}}
    |title = {{{group8<includeonly>|</includeonly>}}}{{{sect8|}}}
    |list1 = {{{list8<includeonly>|</includeonly>}}}
    |image = {{{image8|}}}
    |imageleft = {{{imageleft8|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list8|}}}
}}

|list9 =
{{#if:{{{group9|}}}{{{sect9|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr9}}} |uncollapsed |{{{state9|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group9style|}}}
    |liststyle  = {{{liststyle|}}}{{{list9style|}}}
    |title = {{{group9<includeonly>|</includeonly>}}}{{{sect9|}}}
    |list1 = {{{list9<includeonly>|</includeonly>}}}
    |image = {{{image9|}}}
    |imageleft = {{{imageleft9|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list9|}}}
}}

|list10 =
{{#if:{{{group10|}}}{{{sect10|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr10}}} |uncollapsed |{{{state10|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group10style|}}}
    |liststyle  = {{{liststyle|}}}{{{list1style|}}}
    |title = {{{group10<includeonly>|</includeonly>}}}{{{sect10|}}}
    |list1 = {{{list10<includeonly>|</includeonly>}}}
    |image = {{{image10|}}}
    |imageleft = {{{imageleft10|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list10|}}}
}}

|list11 =
{{#if:{{{group11|}}}{{{sect11|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr11}}} |uncollapsed |{{{state11|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group11style|}}}
    |liststyle  = {{{liststyle|}}}{{{list1style|}}}
    |title = {{{group11<includeonly>|</includeonly>}}}{{{sect11|}}}
    |list1 = {{{list11<includeonly>|</includeonly>}}}
    |image = {{{image11|}}}
    |imageleft = {{{imageleft11|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list11|}}}

}}

|list12 =
{{#if:{{{group12|}}}{{{sect12|}}}
 | {{Navbox|child
    |state = {{#ifeq:{{{selected}}}|{{{abbr12}}} |uncollapsed |{{{state12|collapsed}}}}}
    |titlestyle = {{{basestyle|}}};{{{groupstyle|}}}{{{secttitlestyle|}}}{{{group12style|}}}
    |liststyle  = {{{liststyle|}}}{{{list1style|}}}
    |title = {{{group12<includeonly>|</includeonly>}}}{{{sect12|}}}
    |list1 = {{{list12<includeonly>|</includeonly>}}}
    |image = {{{image12|}}}
    |imageleft = {{{imageleft12|}}}
    |{{#if:{{{listpadding|}}} |listpadding |void}} = {{{listpadding|}}}
   }}
 | {{{list12|}}}

}}
}}

menghasilkan:

Daftar warna

Nama Warna kode Hex
RGB
kode Desimal
RGB
Warna dasar Merah
IndianRed CD 5C 5C 205 92 92
LightCoral F0 80 80 240 128 128
Salmon FA 80 72 250 128 114
DarkSalmon E9 96 7A 233 150 122
LightSalmon FF A0 7A 255 160 122
Crimson DC 14 3C 220 20 60
Red FF 00 00 255 0 0
FireBrick B2 22 22 178 34 34
DarkRed 8B 00 00 139 0 0
Warna dasar Merah Jambu
Pink FF C0 CB 255 192 203
LightPink FF B6 C1 255 182 193
HotPink FF 69 B4 255 105 180
DeepPink FF 14 93 255 20 147
MediumVioletRed C7 15 85 199 21 133
PaleVioletRed DB 70 93 219 112 147
Warna dasar Oranye
LightSalmon FF A0 7A 255 160 122
Coral FF 7F 50 255 127 80
Tomato FF 63 47 255 99 71
OrangeRed FF 45 00 255 69 0
DarkOrange FF 8C 00 255 140 0
Orange FF A5 00 255 165 0
Warna dasar Kuning
Gold FF D7 00 255 215 0
Yellow FF FF 00 255 255 0
LightYellow FF FF E0 255 255 224
LemonChiffon FF FA CD 255 250 205
LightGoldenrodYellow FA FA D2 250 250 210
PapayaWhip FF EF D5 255 239 213
Moccasin FF E4 B5 255 228 181
PeachPuff FF DA B9 255 218 185
PaleGoldenrod EE E8 AA 238 232 170
Khaki F0 E6 8C 240 230 140
DarkKhaki BD B7 6B 189 183 107
Warna dasar Ungu
Lavender E6 E6 FA 230 230 250
Thistle D8 BF D8 216 191 216
Plum DD A0 DD 221 160 221
Violet EE 82 EE 238 130 238
Orchid DA 70 D6 218 112 214
Fuchsia FF 00 FF 255 0 255
Magenta FF 00 FF 255 0 255
MediumOrchid BA 55 D3 186 85 211
MediumPurple 93 70 DB 147 112 219
BlueViolet 8A 2B E2 138 43 226
DarkViolet 94 00 D3 148 0 211
DarkOrchid 99 32 CC 153 50 204
DarkMagenta 8B 00 8B 139 0 139
Purple 80 00 80 128 0 128
Indigo 4B 00 82 75 0 130
SlateBlue 6A 5A CD 106 90 205
DarkSlateBlue 48 3D 8B 72 61 139
Warna dasar Hijau
GreenYellow AD FF 2F 173 255 47
Chartreuse 7F FF 00 127 255 0
LawnGreen 7C FC 00 124 252 0
Lime 00 FF 00 0 255 0
LimeGreen 32 CD 32 50 205 50
PaleGreen 98 FB 98 152 251 152
LightGreen 90 EE 90 144 238 144
MediumSpringGreen 00 FA 9A 0 250 154
SpringGreen 00 FF 7F 0 255 127
MediumSeaGreen 3C B3 71 60 179 113
SeaGreen 2E 8B 57 46 139 87
ForestGreen 22 8B 22 34 139 34
Green 00 80 00 0 128 0
DarkGreen 00 64 00 0 100 0
YellowGreen 9A CD 32 154 205 50
OliveDrab 6B 8E 23 107 142 35
Olive 80 80 00 128 128 0
DarkOliveGreen 55 6B 2F 85 107 47
MediumAquamarine 66 CD AA 102 205 170
DarkSeaGreen 8F BC 8F 143 188 143
LightSeaGreen 20 B2 AA 32 178 170
DarkCyan 00 8B 8B 0 139 139
Teal 00 80 80 0 128 128
Nama Warna kode Hex
RGB
kode Desimal
RGB
Warna dasar Biru
Aqua 00 FF FF 0 255 255
Cyan 00 FF FF 0 255 255
LightCyan E0 FF FF 224 255 255
PaleTurquoise AF EE EE 175 238 238
Aquamarine 7F FF D4 127 255 212
Turquoise 40 E0 D0 64 224 208
MediumTurquoise 48 D1 CC 72 209 204
DarkTurquoise 00 CE D1 0 206 209
CadetBlue 5F 9E A0 95 158 160
SteelBlue 46 82 B4 70 130 180
LightSteelBlue B0 C4 DE 176 196 222
PowderBlue B0 E0 E6 176 224 230
LightBlue AD D8 E6 173 216 230
SkyBlue 87 CE EB 135 206 235
LightSkyBlue 87 CE FA 135 206 250
DeepSkyBlue 00 BF FF 0 191 255
DodgerBlue 1E 90 FF 30 144 255
CornflowerBlue 64 95 ED 100 149 237
MediumSlateBlue 7B 68 EE 123 104 238
RoyalBlue 41 69 E1 65 105 225
Blue 00 00 FF 0 0 255
MediumBlue 00 00 CD 0 0 205
DarkBlue 00 00 8B 0 0 139
Navy 00 00 80 0 0 128
MidnightBlue 19 19 70 25 25 112
Warna dasar Coklat
Cornsilk FF F8 DC 255 248 220
BlanchedAlmond FF EB CD 255 235 205
Bisque FF E4 C4 255 228 196
NavajoWhite FF DE AD 255 222 173
Wheat F5 DE B3 245 222 179
BurlyWood DE B8 87 222 184 135
Tan D2 B4 8C 210 180 140
RosyBrown BC 8F 8F 188 143 143
SandyBrown F4 A4 60 244 164 96
Goldenrod DA A5 20 218 165 32
DarkGoldenrod B8 86 0B 184 134 11
Peru CD 85 3F 205 133 63
Chocolate D2 69 1E 210 105 30
SaddleBrown 8B 45 13 139 69 19
Sienna A0 52 2D 160 82 45
Brown A5 2A 2A 165 42 42
Maroon 80 00 00 128 0 0
Warna dasar Putih
White FF FF FF 255 255 255
Snow FF FA FA 255 250 250
Honeydew F0 FF F0 240 255 240
MintCream F5 FF FA 245 255 250
Azure F0 FF FF 240 255 255
AliceBlue F0 F8 FF 240 248 255
GhostWhite F8 F8 FF 248 248 255
WhiteSmoke F5 F5 F5 245 245 245
Seashell FF F5 EE 255 245 238
Beige F5 F5 DC 245 245 220
OldLace FD F5 E6 253 245 230
FloralWhite FF FA F0 255 250 240
Ivory FF FF F0 255 255 240
AntiqueWhite FA EB D7 250 235 215
Linen FA F0 E6 250 240 230
LavenderBlush FF F0 F5 255 240 245
MistyRose FF E4 E1 255 228 225
Warna dasar Abu-abu
Gainsboro DC DC DC 220 220 220
LightGrey D3 D3 D3 211 211 211
Silver C0 C0 C0 192 192 192
DarkGray A9 A9 A9 169 169 169
Gray 80 80 80 128 128 128
DimGray 69 69 69 105 105 105
LightSlateGray 77 88 99 119 136 153
SlateGray 70 80 90 112 128 144
DarkSlateGray 2F 4F 4F 47 79 79
Black 00 00 00 0 0 0