Template:Data Table
Purpose
Displays tabular data in a way that is mobile-friendly. Minimizes the amount of boilerplate wikitext that most Zelda Wiki tables require. Automatically center-aligns columns and applies templates such as {{Amounts}}
, {{Icon List}}
, {{Rupee}}
, etc.
The table data can stored in Cargo so that the table (or a subset of its rows or columns) can be displayed on other relevant pages using {{Data Table Copy}}
.
Usage
{{Data Table |game= |storeAs= |caption= |collapse= |responsiveModeEnabled= |vertical= |sortable= |stretch= |columns= |<cell1> |<cell2> |<cell3> |... |<cellN> }}
{{Data Table |game= |storeAs= |caption= |collapse= |responsiveModeEnabled= |vertical= |sortable= |stretch= |columns= | | | }}
Parameter | Status | Description | |
---|---|---|---|
game | suggested | A game code. Used to automatically apply game-based templates (e.g. {{Term}} , {{Amounts}} , {{Rupee}} ) to table cells. | |
storeAs | optional | If present, the data is stored in the DataTables Cargo table under the given name. Other pages can retrieve the data by that name using When a page has multiple data tables, each | |
caption | optional | A table caption. | |
collapse | optional | Collapses the table such that only a small preview of the data is shown, with a "show more" button that reveals the full table when clicked. This functionality depends on MediaWiki:Gadget-Collapse.js. | |
responsiveModeEnabled | optional | Data tables have a responsive "mobile-friendly" mode which by default is turned on when:
true or false , respectively. | |
vertical | optional | Lays out the table columns vertically instead of horizontally | |
sortable | optional | If set to false , the data table will not be sortable. | |
stretch | optional | If present and set to anything other than false , the data table will stretch to the full width of the page. | |
columns | required | Comma-separated list of column headers. One or more tag can be appended to each column to indicate how the template should handle data in that column. See #Tags below. | |
| cells | required | Cell values. Type |- to separate rows, as shown in the examples below. |
<p>Displays tabular data in a way that is mobile-friendly. Minimizes the amount of boilerplate wikitext that most {{SITENAME}} tables require. Automatically center-aligns columns and applies templates such as {{Template|Term}}, {{Template|Amounts}}, {{Template|Rupee}}, etc.</p><p>The table data can stored in [[Special:CargoTables/DataTables|Cargo]] so that the table (or a subset of its rows) can be displayed on other relevant pages using {{Template|Data Table Copy}}.
Parameter | Description | Type | Status | |
---|---|---|---|---|
game | game | A game code. Used to automatically apply game-based templates (e.g. {{Template|Term}}, {{Template|Amounts}}, {{Template|Rupee}}) to table cells. | String | suggested |
storeAs | storeAs | <p>If present, the data is stored in the [[Special:CargoTables/DataTables|DataTables]] Cargo table under the given name. Other pages can retrieve the data by that name using {{Template|Data Table Copy}}.</p><p>When a page has multiple data tables, each <code>storeAs</code> value must be unique.</p> | String | optional |
caption | caption | A table caption. | String | optional |
collapse | collapse | Collapses the table such that only a small preview of the data is shown, with a "show more" button that reveals the full table when clicked. This functionality depends on [[MediaWiki:Gadget-Collapse.js]]. | Boolean | optional |
responsiveModeEnabled | responsiveModeEnabled | Data tables have a responsive "mobile-friendly" mode which by default is turned on when:
| Boolean | optional |
vertical | vertical | Lays out the table columns vertically instead of horizontally | Boolean | optional |
sortable | sortable | If set to <code>false</code>, the data table will not be sortable. | Boolean | optional |
stretch | stretch | If present and set to anything other than <code>false</code>, the data table will stretch to the full width of the page. | Boolean | optional |
columns | columns | Comma-separated list of column headers. One or more '''tag''' can be appended to each column to indicate how the template should handle data in that column. See [[#Tags]] below. | Content | required |
cells | ... | Cell values. Type <code>|-</code> to separate rows, as shown in the examples below. | Content | required |
Tags
The following tags can be added to columns to format their content:
Tag | [Amounts] |
---|---|
Alignment | Left |
Sortability | Unsortable |
Effects |
|
Tag | [Code] |
Alignment | Center |
Sortability | Sortable |
Effects | Applies |
Tag | [Defense] |
Alignment | Center |
Sortability | Sortable |
Effects | Applies |
Tag | [Description] |
Alignment | Left |
Sortability | Unsortable |
Effects | Text is shown as-is. |
Tag | [HeartAmount] |
Alignment | Center |
Sortability | Sortable |
Effects | Applies |
Tag | [IconList] |
Alignment | Center |
Sortability | Unsortable |
Effects | Applies |
Tag | [Image] [Image:fileType:size] |
Alignment | Center |
Sortability | UnsortableUnless [Name], [Term] or [SortValue] is applied to the same row. |
Effects |
|
Tag | [Link] |
Alignment | Center |
Sortability | Sortable |
Effects | Renders each cell as an article link. |
Tag | [List] [List:listType] |
Alignment | Center |
Sortability | Unsortable |
Effects | Renders each cell in the column as a list, using commas as list item delimiters. Accepted values for
|
Tag | [LinkList] |
Alignment | Left |
Sortability | Unsortable |
Effects | Renders each comma-separated value in a cell as a link in a bullet list. |
Tag | [Name] |
Alignment | Center |
Sortability | Sortable |
Effects | Text is shown as-is. |
Tag | [Mon] |
Alignment | Left |
Sortability | Sortable |
Effects | Applies |
Tag | [Rupees] [Rupees:game:format] |
Alignment | Left |
Sortability | Sortable |
Effects |
|
Tag | [SyntaxHighlight] [SyntaxHighlight:lang] |
Alignment | Center |
Sortability | Sortable |
Effects | Applies Extension:SyntaxHighlight tags to each cell in the column. lang defaults to |
Tag | [Term] |
Alignment | Center |
Sortability | Sortable |
Effects |
|
Tag | [Transcript] |
Alignment | Left |
Sortability | Unsortable |
Effects | Text is italicized. |
Tag | Alignment | Sortability | Effects |
---|---|---|---|
[Amounts] | Left | Unsortable |
|
[Code] | Center | Sortable | Applies |
[Defense] | Center | Sortable | Applies |
[Description] | Left | Unsortable | Text is shown as-is. |
[HeartAmount] | Center | Sortable | Applies |
[IconList] | Center | Unsortable | Applies |
[Image] [Image:fileType:size] | Center | UnsortableUnless [Name], [Term] or [SortValue] is applied to the same row. |
|
[Link] | Center | Sortable | Renders each cell as an article link. |
[List] [List:listType] | Center | Unsortable | Renders each cell in the column as a list, using commas as list item delimiters. Accepted values for
|
[LinkList] | Left | Unsortable | Renders each comma-separated value in a cell as a link in a bullet list. |
[Name] | Center | Sortable | Text is shown as-is. |
[Mon] | Left | Sortable | Applies |
[Rupees] [Rupees:game:format] | Left | Sortable |
|
[SyntaxHighlight] [SyntaxHighlight:lang] | Center | Sortable | Applies Extension:SyntaxHighlight tags to each cell in the column. lang defaults to |
[Term] | Center | Sortable |
|
[Transcript] | Left | Unsortable | Text is italicized. |
The following tags modify other aspects of the table besides the actual cell content. Some of these do not carry over to copies of the table.
Tag | [Colspan:n] |
---|---|
Copied?Non-copied tags are applied only to the original table and not tables created with Template:Data Table Copy | Copied |
Effects | The specified text spans over the next n columns, grouping them together. |
Tag | [ID] |
Copied?Non-copied tags are applied only to the original table and not tables created with Template:Data Table Copy | Copied |
Effects | Sets the value of the cell as the ID of the table row so that the table row can be linked by that name. See Template:Section for more information. Only one column can have this tag. Bolds cells in the column. |
Tag | [Nowrap] |
Copied?Non-copied tags are applied only to the original table and not tables created with Template:Data Table Copy | Copied |
Effects | Ensures that the column is wide enough to render all cells on a single line by setting the white-space property to |
Tag | [Rowspan] |
Copied?Non-copied tags are applied only to the original table and not tables created with Template:Data Table Copy | Copied |
Effects | When cells in adjacent rows have the same value for the given column, the cells are merged together. |
Tag | [Unsortable] |
Copied?Non-copied tags are applied only to the original table and not tables created with Template:Data Table Copy | Copied |
Effects | Renders the column unsortable. |
Tag | [Width:width] |
Copied?Non-copied tags are applied only to the original table and not tables created with Template:Data Table Copy | Not Copied |
Effects | Sets the width of the column, where width is a CSS length unit. |
Tag | Copied?Non-copied tags are applied only to the original table and not tables created with Template:Data Table Copy | Effects |
---|---|---|
[Colspan:n] | Copied | The specified text spans over the next n columns, grouping them together. |
[ID] | Copied | Sets the value of the cell as the ID of the table row so that the table row can be linked by that name. See Template:Section for more information. Only one column can have this tag. Bolds cells in the column. |
[Nowrap] | Copied | Ensures that the column is wide enough to render all cells on a single line by setting the white-space property to |
[Rowspan] | Copied | When cells in adjacent rows have the same value for the given column, the cells are merged together. |
[Unsortable] | Copied | Renders the column unsortable. |
[Width:width] | Not Copied | Sets the width of the column, where width is a CSS length unit. |
Examples
Amounts
, Description
, Image
, Rupees
, and Term
, as well as the special N/A
value.
{{Data Table |game= SS |storeAs= SS Upgrades |sortable= false |stretch= true |columns= Item [Image][Term], Upgrade [Image][Term], Materials [Amounts], Cost [Rupees], Location [Term], Description [Description] |- | Wooden Shield | Banded Shield | 2 Amber Relic, 1 Monster Claw, 1 Jelly Blob | 30 | Scrap Shop | Increased durability. |- | Banded Shield | Braced Shield | 3 Amber Relic, 2 Monster Claw, 2 Tumbleweed, 1 Ornamental Skull | 50 | Scrap Shop | Further increased durability. |- | Beetle | Hook Beetle | N/A | N/A | Lanayru Desert | Ability to grab items. }}
Item | |
---|---|
Upgrade | |
Materials | |
Cost |
|
Location | |
Description | Increased durability. |
Item | |
Upgrade | |
Materials | |
Cost |
|
Location | |
Description | Further increased durability. |
Item | |
Upgrade | |
Materials | —Not Applicable |
Cost | —Not Applicable |
Location | |
Description | Ability to grab items. |
Figurines in The Minish Cap data table, using the [Image]
tag with a custom file type, as well as the tags ID
, Name
, LinkList
, Unsortable
, and Width
.
[Player Name]
is automatically replaced with Link
or {{Player Name}}
depending on what each tag needs for its output. This is supported only for tags: ID
, Image
, and Name
.
{{Data Table |game= TMC |storeAs= TMC Figurines |columns= Figurine [ID][Image:Figurine Sprite][Name], Number, Description [Description], Subject(s) [LinkList], Pictured [Unsortable][Width:20%] |- | Capless [Player Name] | 001 | A young boy who lives in Hyrule. He is close friends with Princess Zelda. | Link | {{Term|TMC|Link|link}} |- | Ezlo and [Player Name] | 002 | A young boy on a quest with Ezlo to restore the Four Sword.<br/>With the sword's power, he hopes to remove the curse on Princess Zelda. | Ezlo, Link | {{Term|TMC|Ezlo|link}} and {{Term|TMC|Link|link}} |- | Princess Zelda | 003 | A bright and cheery princess from Hyrule's royal family.<br/>She loves to sneak out of the castle to visit her good friend, {{Player Name}}. | Princess Zelda | {{Term|TMC|Princess Zelda|link}} }}
Figurine | |
---|---|
Number | 001 |
Description | A young boy who lives in Hyrule. He is close friends with Princess Zelda. |
Subject(s) | |
Pictured | |
Figurine | |
Number | 002 |
Description | A young boy on a quest with Ezlo to restore the Four Sword. |
Subject(s) | |
Pictured | |
Figurine | |
Number | 003 |
Description | A bright and cheery princess from Hyrule's royal family. |
Subject(s) | |
Pictured |
Figurine | Number | Description | Subject(s) | Pictured |
---|---|---|---|---|
001 | A young boy who lives in Hyrule. He is close friends with Princess Zelda. | |||
002 | A young boy on a quest with Ezlo to restore the Four Sword. | |||
003 | A bright and cheery princess from Hyrule's royal family. |
Image
is used with a custom image size.
{{Data Table |game= TWW |storeAs= TWW Figurines |columns= Figurine [ID][Image:Figurine Model:x150px][Name], Subject(s) [LinkList], Description [Description] |- | Darknut | Darknut | Habitat: [[Tower of the Gods]]<br/>Spoils: [[Knight's Crest]]<br/><br/>These mighty knights are protected by heavy-duty armor. Rather than attacking from the front, it might be best to slip around behind them and cut their armor off. |- | Darknut [2] | Darknut | Habitat: [[Earth Temple (The Wind Waker)|Earth Temple]]<br/>Spoil: [[Knight's Crest]]<br/><br/>These knights are well protected by their round bucklers and mighty armor. If you use a [[Parry|parry attack]] to jump up and knock off their helmets, it'll spell their doom. }}
Figurine | |
---|---|
Subject(s) | |
Description | Habitat: Tower of the Gods |
Figurine | |
Subject(s) | |
Description | Habitat: Earth Temple |
Figurine | Subject(s) | Description |
---|---|---|
Habitat: Tower of the Gods | ||
Habitat: Earth Temple |
{{Data Table |game= BotW |collapse= true |columns= Dye [ID][Image:Icon:144px][Name], Materials [IconList] |- | Blue Dye | Chillshroom, Blue Nightshade, Winterwing Butterfly, Cold Darner, Hearty Lizard, Sapphire, Icy Lizalfos Tail, Ice Keese Wing |- | Red Dye | Apple, Spicy Pepper, Hylian Shroom, Sunshroom, Summerwing Butterfly, Warm Darner, Ruby, Red Lizalfos Tail, Red Chuchu Jelly, Fire Keese Wing }}
{{Data Table |game= BotW |columns= Armor [Rowspan][Term], Level, Defense [Defense] |- | Amber Earrings | ★ | 7 |- | Amber Earrings | ★★ | 12 |- | Ancient Set | ★★★ | 18 |- | Ancient Set | ★★★★ | 28 }}
Colspan
, Nowrap
, and LinkList
tags. Rupees
is also used with custom games.
{{Data Table |game= TWWHD |storeAs= Spoils |columns= Spoil [Image:Artwork][Term][Nowrap], Enemies [LinkList][Nowrap], Sell Price [Colspan:2], {{TWW|-}} [Rupees:TWW], {{TWWHD|-}} [Rupees:TWWHD], Uses [Description] |- | Red Chu Jelly | Red ChuChu, Yellow ChuChu, Dark ChuChu | 1 | 10 | Making [[Red Potion]] by giving five of them to Doc Bandam. |- | Green Chu Jelly | Green ChuChu, Yellow ChuChu, Dark ChuChu | 2 | 10 | Making [[Green Potion]] by giving 15 of them to Doc Bandam (five each subsequent time). |- | Blue Chu Jelly | Blue ChuChu | 3 | 15 | Making [[Blue Potion]] by giving 15 of them to [[Doc Bandam]] (five each subsequent time). |- | Boko Baba Seed | Boko Baba | 5 | 20 | Making [[Blue Potion]] by giving four of them to [[Hollo]]. }}
Spoil | ||
---|---|---|
Enemies | ||
Sell Price | The Wind Waker |
|
The Wind Waker HD |
| |
Uses | Making Red Potion by giving five of them to Doc Bandam. | |
Spoil | ||
Enemies | ||
Sell Price | The Wind Waker |
|
The Wind Waker HD |
| |
Uses | Making Green Potion by giving 15 of them to Doc Bandam (five each subsequent time). | |
Spoil | ||
Enemies | ||
Sell Price | The Wind Waker |
|
The Wind Waker HD |
| |
Uses | Making Blue Potion by giving 15 of them to Doc Bandam (five each subsequent time). | |
Spoil | ||
Enemies | ||
Sell Price | The Wind Waker |
|
The Wind Waker HD |
| |
Uses | Making Blue Potion by giving four of them to Hollo. |
Spoil | Enemies | Sell Price | Uses | |
---|---|---|---|---|
The Wind Waker | The Wind Waker HD | |||
|
| Making Red Potion by giving five of them to Doc Bandam. | ||
|
| Making Green Potion by giving 15 of them to Doc Bandam (five each subsequent time). | ||
|
| Making Blue Potion by giving 15 of them to Doc Bandam (five each subsequent time). | ||
|
| Making Blue Potion by giving four of them to Hollo. |
{{Data Table |game= TWWHD |columns= Jelly [Term], Potion [Image][Term], Enemies [LinkList], Sell Price [Rupees] |- | Blue Chu Jelly | | | }}
The following data table is incomplete. You can help Zelda Wiki by editing the page to fill in the empty cells.
Jelly | Potion | Enemies | Sell Price |
---|---|---|---|
{{Data Table |game= TWWHD |columns= Foo [InvalidTag] |- | bar }}
Foo |
---|
bar |
Extensions
The following templates extend the functionality of this template:
- Template:Data Table/Armor
- Template:Data Table/Armor Levels
- Template:Data Table/Descriptions
- Template:Data Table/Upgrades
These generally templates work the same way, but in addition store some or all of the data in a dedicated Cargo table for use by Cargo Query Templates. For example, Template:Data Table/Upgrades stores data in the Upgrades table for use by Template:Upgrades.
Guidelines
- When editing a data table that uses the
storedAs
parameter, be aware that this may break copies of the table that look for specific columns or row data.- This is also the case for any of the data table extensions listed above. Be especially careful with this data as it is usually used in several articles.
- Category:Pages with data tables lists all the pages that copy a particular data table. After changing a data table, it is recommended to check all the pages that query it. You may need to purge the copying page's cache for any changes to appear in the copy.
- When a column does not apply to a particular row, use the special
N/A
value rather than leaving the cell blank.- Pages with blank data table cells are added to Category:Articles with incomplete data.