Template:Legend table
This template displays a table to provide the legend for a chart or diagram that uses colours.
The template allows for 16 pairs of colour / description.
Parameters
[edit ]- 1
- Colour for the first legend. Colours may be names, RGB codes of the form #88FF66 or #456
- 2
- Text of the first legend
- 3,5,7 ... 31
- Further colours. The template allows for 16 colours in the list
- 4,6,8 ... 32
- Further texts
- invert
- If nonempty, invert in dark mode. Often useful for tables.
- title
- Optional title displayed above the colour list
- title-align
- Alternative alignment for the title. If omitted, the title is centred.
- style
- Complete replacement of the default style. The default style sets a background colour and an enclosing border.
- width
- Replacement for the default width of 100%.
width=autowill display a box that just fits the legend table. - notes
- Optional footnotes displayed after the colour list.
Examples
[edit ]{{legend table|width=auto |red|Red |green|Green |blue|Blue }}
Gives:
{{legend table|title=This is an optional title |#000000|Kosovo |#0052ff|States which formally recognise Kosovo as independent.<sup>1</sup> |#5fadff|States which have stated they intend to recognise formally Kosovo as independent. |#cdcd9c|States with undecided, unclear or ambiguous positions. |#E5A238|States which have expressed disagreement with unilateral moves or expressed wish for further negotiations. |#FF4500|States which have stated they will not recognise Kosovo as independent. |#a3a3a3|States with no reported position at present. |notes=<sup>1</sup>These are optional footnotes. }}
Gives:
1These are optional footnotes.
{{legend-table|title-align=left|width=auto|title=Periodic table key legend |#006000|The [[CHON|four basic organic elements]] |#00b000|Quantity elements |#7f0|Essential [[dietary element|trace elements]] |#ee0|Essentiality or function debated |#ebba36|Not essential in humans, but essential for some non-human eukaryotes |#ffc4ef|Not essential in eukaryotes, but essential for some prokaryotes |invert=yes}}
Gives:
See also
[edit ]- {{Legend }}
- {{Legend inline }}
- Lists of colors
- Web colors
This template displays a table to provide the legend for a chart or diagram that uses colours. The template allows for 16 pairs of colour / description.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Style | style | Complete replacement of the default style. The default style sets a background colour and an enclosing border. | String | optional |
| Width | width | Replacement for the default width of 100%. 'auto' will display a box that just fits the legend table. | String | optional |
| Title | title | Optional title displayed above the colour list. | String | optional |
| Title align | title-align align | Alternative alignment for the title. If omitted, the title is centred.
| String | optional |
| Notes | notes | Optional footnotes displayed after the colour list. | Content | optional |
| Invert in dark mode | invert | If nonempty, invert in dark mode. | Content | optional |
| Color 1 | 1 c color c1 color1 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | suggested |
| Label 1 | 2 t text label t1 text1 label1 | Text or content to label the legend. | Content | suggested |
| Color 2 | 3 c2 color2 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 2 | 4 t2 text2 label2 | Text or content to label the legend. | Content | optional |
| Color 3 | 5 c3 color3 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 3 | 6 t3 text3 label3 | Text or content to label the legend. | Content | optional |
| Color 4 | 7 c4 color4 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 4 | 8 t4 text4 label4 | Text or content to label the legend. | Content | optional |
| Color 5 | 9 c5 color5 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 5 | 10 t5 text5 label5 | Text or content to label the legend. | Content | optional |
| Color 6 | 11 c6 color6 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 6 | 12 t6 text6 label6 | Text or content to label the legend. | Content | optional |
| Color 7 | 13 c7 color7 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 7 | 14 t7 text7 label7 | Text or content to label the legend. | Content | optional |
| Color 8 | 15 c8 color8 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 8 | 16 t8 text8 label8 | Text or content to label the legend. | Content | optional |
| Color 9 | 17 c9 color9 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 9 | 18 t9 text9 label9 | Text or content to label the legend. | Content | optional |
| Color 10 | 19 c10 color10 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 10 | 20 t10 text10 label10 | Text or content to label the legend. | Content | optional |
| Color 11 | 21 c11 color11 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 11 | 22 t11 text11 label11 | Text or content to label the legend. | Content | optional |
| Color 12 | 23 c12 color12 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 12 | 24 t12 text12 label12 | Text or content to label the legend. | Content | optional |
| Color 13 | 25 c13 color13 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 13 | 26 t13 text13 label13 | Text or content to label the legend. | Content | optional |
| Color 14 | 27 c14 color14 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 14 | 28 t14 text14 label14 | Text or content to label the legend. | Content | optional |
| Color 15 | 29 c15 color15 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 15 | 30 t15 text15 label15 | Text or content to label the legend. | Content | optional |
| Color 16 | 31 c16 color16 | Colour for the legend. Colours may be names or RGB codes of either 6 or 3 digits.
| Line | optional |
| Label 16 | 32 t16 text16 label16 | Text or content to label the legend. | Content | optional |
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.