Difference between revisions of "Nookipedia:Project Items/Table Templates"
AlexBot2004 (talk | contribs) |
PanchamBro (talk | contribs) |
||
(11 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
− | [[File: | + | [[File:Modern End Table (Gold Nugget) NL Model.png|thumb|100px|Not THAT table! Even if it is shiny!]] |
− | The following sections show you | + | The following sections show you how each template works to create different parts of the table.<ref>'''Important''': Figuring out how {{t|TableTop}} works doesn't guarantee you getting those overpriced GracieGrace furniture.</ref> If you're still confused on how to use these templates, head over to some of the more completed furniture pages and edit the page to study the coding structure. If you need any one-on-one help, you can contact any of our members, preferably our more active, experienced ones (or [[User:Sunmarsh|sunmarsh]], he's the <s>complete moron</s> absolute genius who made them). Oh, and remember to use the preview button before you save! |
+ | __TOC__ | ||
+ | ==Template:TableTop== | ||
+ | This template will automatically create a collapsible container for the table as well as its column heading labels. By inputting the correct parameters, the table will automatically generate a table with the appropriate amount of columns for the list you are creating. It is generally advisable however to create a new template using TableTop, with the ability to change the name of the template (e.g. [[Template:TableTop NH Furniture]]). | ||
− | == | + | ===Usage=== |
− | + | <pre> | |
+ | {{TableTop | ||
+ | |color = items, bug, or fish (default is items) | ||
+ | |title = | ||
+ | |collapsible = (default is not collapsible) | ||
+ | |collapsed = (default is not collapsed) | ||
+ | |sortable = (default is not sortable) | ||
+ | |column1 = | ||
+ | |column2 = | ||
+ | ... | ||
+ | |columnX = | ||
+ | }} | ||
+ | </pre> | ||
− | *''' | + | *'''title''' - Specifies the title of the subject in question. Recommended to format parameter as <code><nowiki>{{{name|<subject>}}} in {{<game abbreviation>|nolink}}</nowiki></code> if creating a template using TableTop. |
− | *''' | + | *'''color''' - Specifies the color of the TableTop. List of colors is available [[Help:Tables#Styling|here]]. |
− | *''' | + | *'''collapsible''' - Specifies if the table can be collapsed. |
− | *''' | + | *'''collapsed''' - Specifies if the table is collapsed by default. |
+ | *'''sortable''' - Specifies if the table can sort values. | ||
+ | *'''column1''', '''column2''', etc. - Species the column's name when in use. | ||
− | + | ===Example=== | |
+ | Let's say you want to create a furniture table for the Antique Series in {{NH}}. You would first create a template using TableTop, such as with [[Template:TableTop NH Furniture]], and then output the following wikitext code: | ||
− | <pre>{{ | + | <pre>{{TableTop NH Furniture|name=Antique Series}}</pre> |
and it produces: | and it produces: | ||
− | {{ | + | {{TableTop NH Furniture|name=Antique Series}} |
{{TableFooter}}<br> | {{TableFooter}}<br> | ||
==Template:TableContent== | ==Template:TableContent== | ||
− | This template formats each cell's contents appropriately and automatically creates new rows. It does not have any required parameters. | + | This template formats each cell's contents appropriately and automatically creates new rows. It does not have any required parameters. This template is only advisable for games that do not currently have Cargo data. |
− | + | ===Example=== | |
+ | Let's try the template out on a bug table... | ||
<pre>{{TableHeader|game=ACCF|type=insect|collection=other|title=List of bugs in ''Animal Crossing: City Folk''}} | <pre>{{TableHeader|game=ACCF|type=insect|collection=other|title=List of bugs in ''Animal Crossing: City Folk''}} | ||
Line 28: | Line 47: | ||
| 1 | | 1 | ||
| Common Butterfly | | Common Butterfly | ||
− | | [[File:Common Butterfly | + | | [[File:Common Butterfly CF Icon.png|64px]] |
| 90 | | 90 | ||
| Common | | Common | ||
Line 46: | Line 65: | ||
| 1 | | 1 | ||
| [[Common butterfly]] | | [[Common butterfly]] | ||
− | | [[File:Common Butterfly | + | | [[File:Common Butterfly CF Icon.png|64px]] |
| 90 | | 90 | ||
| Common | | Common | ||
Line 58: | Line 77: | ||
==Template:TableFooter== | ==Template:TableFooter== | ||
− | This template will produce the appropriate closing tags for a table and its container. If you don't end your tables with this tag, they will take up the entire page and may 'swallow' other elements on the page. That's not good! Your tables don't deserve this! | + | This template will produce the appropriate closing tags for a table and its container. If you don't end your tables with this tag, they will take up the entire page and may 'swallow' other elements on the page. That's not good! Your tables don't deserve this! |
− | {{ | + | |
+ | Optionally, the TableFooter can also use the parameter <code>note</code> either to provide attribution or to annotate some parts of the table. There is also an optional <code>div</code> parameter provided, though its use will soon be deprecated following consolidation of the two separate tables for furniture and interior items into one. | ||
+ | |||
+ | ===Example=== | ||
+ | <pre> | ||
+ | {{TableTop NH Furniture|name=Antique Series}} | ||
+ | |||
+ | {{#invoke:NHFurnitureCargoQuery|main|limit=1|group by=nh_furniture.en_name|where=item_series='Antique'|order by=nh_furniture.catalog_num}} | ||
− | {{ | + | {{TableFooter|note={{Community:ACNH Spreadsheet/Attribution}}}} |
− | + | </pre> | |
− | |||
− | |||
− | |||
− | |||
− | | {{ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | |||
− | |||
− | + | Output: | |
− | + | {{TableTop NH Furniture|name=Antique Series}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == | + | {{#invoke:NHFurnitureCargoQuery|main|limit=1|group by=nh_furniture.en_name|where=item_series='Antique'|order by=nh_furniture.catalog_num}} |
− | |||
− | + | {{TableFooter|note={{Community:ACNH Spreadsheet/Attribution}}}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==References== | ==References== | ||
− | + | {{Reflist}} |
Latest revision as of 22:01, June 15, 2024
The following sections show you how each template works to create different parts of the table.[1] If you're still confused on how to use these templates, head over to some of the more completed furniture pages and edit the page to study the coding structure. If you need any one-on-one help, you can contact any of our members, preferably our more active, experienced ones (or sunmarsh, he's the complete moron absolute genius who made them). Oh, and remember to use the preview button before you save!
Template:TableTop[edit]
This template will automatically create a collapsible container for the table as well as its column heading labels. By inputting the correct parameters, the table will automatically generate a table with the appropriate amount of columns for the list you are creating. It is generally advisable however to create a new template using TableTop, with the ability to change the name of the template (e.g. Template:TableTop NH Furniture).
Usage[edit]
{{TableTop |color = items, bug, or fish (default is items) |title = |collapsible = (default is not collapsible) |collapsed = (default is not collapsed) |sortable = (default is not sortable) |column1 = |column2 = ... |columnX = }}
- title - Specifies the title of the subject in question. Recommended to format parameter as
{{{name|<subject>}}} in {{<game abbreviation>|nolink}}
if creating a template using TableTop. - color - Specifies the color of the TableTop. List of colors is available here.
- collapsible - Specifies if the table can be collapsed.
- collapsed - Specifies if the table is collapsed by default.
- sortable - Specifies if the table can sort values.
- column1, column2, etc. - Species the column's name when in use.
Example[edit]
Let's say you want to create a furniture table for the Antique Series in Animal Crossing: New Horizons. You would first create a template using TableTop, such as with Template:TableTop NH Furniture, and then output the following wikitext code:
{{TableTop NH Furniture|name=Antique Series}}
and it produces:
Antique Series in Animal Crossing: New Horizons
# | Item | Image | Buy price | Sell price | Available from | HHA theme(s) | Interact | Customizable | Size |
---|
Template:TableContent[edit]
This template formats each cell's contents appropriately and automatically creates new rows. It does not have any required parameters. This template is only advisable for games that do not currently have Cargo data.
Example[edit]
Let's try the template out on a bug table...
{{TableHeader|game=ACCF|type=insect|collection=other|title=List of bugs in ''Animal Crossing: City Folk''}} {{TableContent|type=insect | 1 | Common Butterfly | [[File:Common Butterfly CF Icon.png|64px]] | 90 | Common | 50mm | Near flowers | <small>March - June:</small> 4AM - 7PM<br><small>September:</small> 8AM - 4PM | J F <font color{{=}}"#32B311">'''M A M J'''</font> J A <font color{{=}}"#32B311">'''S'''</font> O N D | - }}
Important: Notice how the equals signs for the text in the months column are enclosed in brackets (<font color{{=}}...). This is because cell contents cannot contain a raw equals sign due to how the template is coded. |
Produces:
List of bugs in Animal Crossing: City Folk
# | Name | Image | Price | Rarity | Size | Location | Time | Months | Peak |
---|---|---|---|---|---|---|---|---|---|
1 | Common butterfly | 90 | Common | 50mm | Near flowers | March - June: 4 AM - 7 PM September: 8 AM - 4 PM |
J F M A M J J A S O N D | - |
[edit]
This template will produce the appropriate closing tags for a table and its container. If you don't end your tables with this tag, they will take up the entire page and may 'swallow' other elements on the page. That's not good! Your tables don't deserve this!
Optionally, the TableFooter can also use the parameter note
either to provide attribution or to annotate some parts of the table. There is also an optional div
parameter provided, though its use will soon be deprecated following consolidation of the two separate tables for furniture and interior items into one.
Example[edit]
{{TableTop NH Furniture|name=Antique Series}} {{#invoke:NHFurnitureCargoQuery|main|limit=1|group by=nh_furniture.en_name|where=item_series='Antique'|order by=nh_furniture.catalog_num}} {{TableFooter|note={{Community:ACNH Spreadsheet/Attribution}}}}
Output:
Antique Series in Animal Crossing: New Horizons
# | Item | Image | Buy price | Sell price | Available from | HHA theme(s) | Interact | Customizable | Size |
---|---|---|---|---|---|---|---|---|---|
34 | Antique bed | 28,000 Bells | 7,000 Bells | Nook's Cranny (upgraded) |
Retro / Expensive | Bed | No |