Editing Template:Navbox with columns/doc
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>{{template doc page transcluded}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude> | <includeonly>{{template doc page transcluded}}</includeonly><noinclude>{{template doc page viewed directly}}</noinclude> | ||
− | + | <!-- EDIT TEMPLATE DOCUMENTATION BELOW THIS LINE --> | |
A navigation box that presents its content in columns. Originally intended to provide a relatively straightforward means to align links prefixed by flag icons, e.g. in templates offering links to country articles. | A navigation box that presents its content in columns. Originally intended to provide a relatively straightforward means to align links prefixed by flag icons, e.g. in templates offering links to country articles. | ||
Line 6: | Line 6: | ||
Only required parameters and ''colwidth'' included. | Only required parameters and ''colwidth'' included. | ||
− | <pre style="overflow:auto;"> | + | <pre style="font-size:95%; overflow:auto;"> |
{{Navbox with columns | {{Navbox with columns | ||
|name = {{subst:PAGENAME}} | |name = {{subst:PAGENAME}} | ||
Line 19: | Line 19: | ||
== Parameters == | == Parameters == | ||
− | Required parameters in '''bold'''. Parameters marked with a cross'''<sup>†</sup>''' are parameters in common with the sister | + | Required parameters in '''bold'''. Parameters marked with a cross'''<sup>†</sup>''' are parameters in common with the sister template {{t1|Navbox}}. A much more complete description of those parameters is available there. |
===Setup parameters=== | ===Setup parameters=== | ||
:;name<sup>†</sup> | :;name<sup>†</sup> | ||
− | ::The name of the template. The name of this template, for example, is " | + | ::The name of the template. The name of this template, for example, is "Navigation with columns". |
:;state<sup>†</sup> | :;state<sup>†</sup> | ||
− | ::Possible values are <code>collapsed</code>, <code>uncollapsed</code>, <code>plain</code>, <code>off</code>, and the default <code>autocollapse</code> | + | ::Possible values are <code>collapsed</code>, <code>uncollapsed</code>, <code>plain</code>, <code>off</code>, and the default <code>autocollapse</code>. |
:;''navbar''<sup>†</sup> | :;''navbar''<sup>†</sup> | ||
− | ::Possible values are <code>plain</code>, <code>off</code>, and the default value of blank | + | ::Possible values are <code>plain</code>, <code>off</code>, and the default value of blank. |
:;''border''<sup>†</sup> | :;''border''<sup>†</sup> | ||
− | ::Possible values are <code>child</code>, <code>none</code>, and the default value of blank | + | ::Possible values are <code>child</code>, <code>none</code>, and the default value of blank. |
===Basic data parameters=== | ===Basic data parameters=== | ||
Line 39: | Line 39: | ||
:;''above''<sup>†</sup> | :;''above''<sup>†</sup> | ||
− | + | :Text or other elements to appear above the columns. | |
:;''image''<sup>†</sup> | :;''image''<sup>†</sup> | ||
Line 62: | Line 62: | ||
:;''basestyle''<sup>†</sup> | :;''basestyle''<sup>†</sup> | ||
− | ::CSS style/s to apply to the ''title'', ''above'', | + | ::CSS style/s to apply to the ''title'', ''above'', ''below'', and ''group'' parameters, all at the same time. |
:;''imagestyle''<sup>†</sup> | :;''imagestyle''<sup>†</sup> | ||
Line 70: | Line 70: | ||
::CSS style/s to apply to the ''imageleft'' parameter | ::CSS style/s to apply to the ''imageleft'' parameter | ||
− | :;'' | + | :;''colsstyle'' |
::CSS style/s to apply across all columns; if used, usually <code>background:''color''</code> per ''titlestyle'' above. | ::CSS style/s to apply across all columns; if used, usually <code>background:''color''</code> per ''titlestyle'' above. | ||
Line 82: | Line 82: | ||
:;''colheaderstyle'' | :;''colheaderstyle'' | ||
::CSS style/s to apply to all column headers. | ::CSS style/s to apply to all column headers. | ||
+ | |||
+ | :;''colheader2style'' | ||
+ | ::CSS style/s to apply to all second level columns headers. | ||
:;''col<sub>n</sub>headerstyle'' | :;''col<sub>n</sub>headerstyle'' | ||
::CSS style/s to apply to the n<sup>th</sup> column header. | ::CSS style/s to apply to the n<sup>th</sup> column header. | ||
− | :;''col<sub>n</sub> | + | :;''col<sub>n</sub>headerstyle2'' |
+ | ::CSS style/s to apply to the n<sup>th</sup> second level column header. | ||
+ | |||
+ | :;''col<sub>n</sub>footer'' | ||
::CSS style/s to apply to the n<sup>th</sup> column footer cell. | ::CSS style/s to apply to the n<sup>th</sup> column footer cell. | ||
Line 94: | Line 100: | ||
:::<code>colwidth = 15em</code> | :::<code>colwidth = 15em</code> | ||
:::<code>colwidth = 25%</code> | :::<code>colwidth = 25%</code> | ||
− | |||
− | |||
− | |||
− | |||
:;''padding'' | :;''padding'' | ||
Line 106: | Line 108: | ||
:;'''''col<sub>n</sub>''''' | :;'''''col<sub>n</sub>''''' | ||
− | ::The content of the n<sup>th</sup> column. | + | ::The content of the n<sup>th</sup> column. <code>col1</code> is required. There can be a maximum of 12 columns. |
:;''col<sub>n</sub>header'' | :;''col<sub>n</sub>header'' | ||
− | ::A header cell for the n<sup>th</sup> column that appears above the column. | + | ::A header cell for the n<sup>th</sup> column that appears above the column. |
+ | |||
+ | :;''col<sub>n</sub>header2 | ||
+ | ::A second header cell for the n<sup>th</sup> column that appears above the column, but below the first header cell. | ||
:;''col<sub>n</sub>footer | :;''col<sub>n</sub>footer | ||
::A footer cell that appears below the n<sup>th</sup> column. | ::A footer cell that appears below the n<sup>th</sup> column. | ||
+ | ===Customization parameters for the column headers and footer=== | ||
:;''col<sub>n</sub>headercolspan | :;''col<sub>n</sub>headercolspan | ||
::A number specifying how many columns the n<sup>th</sup> 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 <code>col1headercolspan = 3</code>, then leave <code>col2header</code> and <code>col3header</code> blank. | ::A number specifying how many columns the n<sup>th</sup> 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 <code>col1headercolspan = 3</code>, then leave <code>col2header</code> and <code>col3header</code> blank. | ||
+ | |||
+ | :;''col<sub>n</sub>headerrowspan | ||
+ | ::Set to either 1 or 2; defaults to 1. The number of rows that the n<sup>th</sup> column header should span. Only set to two if you intend to set colNheader2 for the remaining columns. | ||
+ | |||
+ | :;''col<sub>n</sub>header2colspan | ||
+ | ::A number specifying how many columns the n<sup>th</sup> second level 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 <code>col1header2colspan = 3</code>, then leave <code>col2header2</code> and <code>col3header3</code> blank. | ||
:;''col<sub>n</sub>footercolspan | :;''col<sub>n</sub>footercolspan | ||
− | ::A number specifying how many columns the n<sup>th</sup> 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 <code> | + | ::A number specifying how many columns the n<sup>th</sup> 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 <code>col1footerspan = 3</code>, then leave <code>col2footer</code> and <code>col3footer</code> blank. |
− | ===Additional lists=== | + | ===Additional groups/lists=== |
You may wish to add a few extra lists below the columns. The following parameters are given to provide such functionality. See {{t1|Navbox}} for a more complete description of how they work, and for more examples. Groups are not allowed. | You may wish to add a few extra lists below the columns. The following parameters are given to provide such functionality. See {{t1|Navbox}} for a more complete description of how they work, and for more examples. Groups are not allowed. | ||
− | :;''list<sub>n</sub>'' | + | :;''list<sub>n</sub>'' |
::Allows up to 6 additional lists below the columns. | ::Allows up to 6 additional lists below the columns. | ||
− | :;''liststyle'' | + | :;''liststyle'' |
::The general CSS style/s for the lists. | ::The general CSS style/s for the lists. | ||
− | :;''list<sub>n</sub>style'' | + | :;''list<sub>n</sub>style'' |
::CSS style/s for the n<sup>th</sup> list parameter. | ::CSS style/s for the n<sup>th</sup> list parameter. | ||
− | |||
− | |||
== Examples == | == Examples == | ||
Line 209: | Line 219: | ||
|colwidth = 25% | |colwidth = 25% | ||
− | |col1header = | + | |col1header = Col1Header |
− | |col2header = | + | |col2header = Col2Header |
− | |col3header = | + | |col3header = Col3Header |
− | |col4header = | + | |col4header = Col4Header |
− | |col1 = | + | |col1 = Col1 |
− | |col2 = | + | |col2 = Col2 |
− | |col3 = | + | |col3 = Col3 |
− | |col4 = | + | |col4 = Col4 |
− | |col1footer = | + | |col1footer = Col1Footer |
− | |col2footer = | + | |col2footer = Col2Footer |
− | |col3footer = | + | |col3footer = Col3Footer |
− | |col4footer = | + | |col4footer = Col4Footer |
}} | }} | ||
− | === | + | |
− | The gray background for the columns is added for illustration only. | + | ===Advanced col<sub>n</sub>header example=== |
+ | This example shows how to use the col<sub>n</sub>headerrowspan and col<sub>n</sub>headercolspan features to make the headers look the way you want. This one uses both header levels. The gray background for the columns is added for illustration only. | ||
{{Navbox with columns | {{Navbox with columns | ||
|name = Navbox with columns/doc | |name = Navbox with columns/doc | ||
|state = uncollapsed | |state = uncollapsed | ||
− | |title = | + | |title = Row/colspan tests |
|colstyle = text-align:center;background:silver; | |colstyle = text-align:center;background:silver; | ||
+ | |colwidth = 15% | ||
+ | |col1width = 12% | ||
+ | |col2width = 13% | ||
− | | | + | |col1headercolspan = 2 |
− | | | + | |col3headerrowspan = 2 |
− | | | + | |col4headercolspan = 3 |
− | | | + | |col7headerrowspan = 2 |
− | | | + | |col1header = Col1Header |
− | | | + | |col1header2 = Col1Header2 |
+ | |col2header2 = Col2Header2 | ||
+ | |col3header = Col3Header | ||
+ | |col4header = Col4Header | ||
+ | |col4header2 = Col4Header2 | ||
+ | |col5header2 = Col5Header2 | ||
+ | |col6header2 = Col6Header2 | ||
+ | |col7header = Col7Header | ||
− | |col1 = | + | |col1 = Col1 |
− | |col2 = | + | |col2 = Col2 |
− | |col3 = | + | |col3 = Col3 |
− | |col4 = | + | |col4 = Col4 |
− | |col5 = | + | |col5 = Col5 |
− | |col6 = | + | |col6 = Col6 |
− | |col7 = | + | |col7 = Col7 |
}} | }} | ||
+ | |||
==Using child navboxes== | ==Using child navboxes== | ||
− | All three types of navbox templates, namely {{t1|Navbox}}, {{t1|Navbox with columns}}, and {{t1|Navbox with collapsible | + | All three types of navbox templates, namely {{t1|Navbox}}, {{t1|Navbox with columns}}, and {{t1|Navbox with collapsible sections}}, can be nested inside of one another using the <code>border</code> parameter (which is common to all three). For complex templates, it may be necessary to use nesting to achieve a desired look. |
− | |||
This example shows how one can nest multiple {{t1|Navbox with columns}} templates to get the right look. Edit this section to view the code. There is a main {{t1|Navbox with columns}} and two additional {{t1|Navbox with columns}} templates, with the "child" option set (see code). | This example shows how one can nest multiple {{t1|Navbox with columns}} templates to get the right look. Edit this section to view the code. There is a main {{t1|Navbox with columns}} and two additional {{t1|Navbox with columns}} templates, with the "child" option set (see code). | ||
{{Navbox with columns | {{Navbox with columns | ||
Line 300: | Line 321: | ||
|col4 = Col4 | |col4 = Col4 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}} | }} | ||
== See also == | == See also == | ||
* {{t1|Navbox}} – Allows groups/lists instead of columns | * {{t1|Navbox}} – Allows groups/lists instead of columns | ||
− | * {{t1|Navbox with collapsible | + | * {{t1|Navbox with collapsible sections}} – Another variation. |
{{Navigational templates}} | {{Navigational templates}} | ||
Line 399: | Line 335: | ||
<!--Other languages--> | <!--Other languages--> | ||
− | |||
[[ja:Template:Navbox with columns]] | [[ja:Template:Navbox with columns]] | ||
[[mk:Шаблон:Navbox with columns]] | [[mk:Шаблон:Navbox with columns]] | ||
− | |||
[[sl:Predloga:Navigacija s stolpci]] | [[sl:Predloga:Navigacija s stolpci]] | ||
− | |||
</includeonly> | </includeonly> |