Template:Cost

From Lotro-Wiki.com
Jump to navigation Jump to search
This is the template documentation for {{Cost}}. It is transcluded from Template:Cost/doc and may be directly edited there.

Description

This template is for displaying price tables which can be sorted by price. The gold, silver, and copper coins each appear in their own "sub-column" for easy visual comparison.

Syntax

The gold, silver, and copper values can be specified with positional arguments:

{{Cost|<gold>|<silver>|<copper>}}

Or they may be specified with named arguments:

{{Cost|g=<gold>|s=<silver>|c=<copper>}}

Example

{| class="altRowsCenter sortable" style="width:30em"
! Item || style="width:11.5em" | Cost
|-
| Apples || {{Cost|2|100|55}}
|-
| Oranges || {{Cost|700}}     
|-
| Pears || {{Cost||122|50}}   
|-
| Celery || {{Cost|c=99}}   
|-
| Onions || {{Cost|1|500}}
|}

Result

Item Cost
Apples Gold100 Silver55 Copper
Oranges 700 Gold
Pears 122 Silver50 Copper
Celery 99 Copper
Onions Gold500 Silver

Usage note

It is not necessary to manually add the "text-align:right" style to each table cell:

| Onions || style="text-align:right" | {{Cost|1|500}}

This is automatically output by the template, so the above will cause an error.