User:Ham105/sandbox/p23

This template is for including medal symbols in sporting event result tables, while preserving the ability for sort.

Template series
The first group of templates show medal images while giving a table sort of 01, 02 or 03, respectively.

The second group of templates are show medal images with display text of either Gold, Silver, Bronze. These also give a table sort of 01, 02 or 03, respectively.

Usage
Simply insert the template where you would like to see the symbol. No parameters are required.

Sorting will work numerically unless the column contains any non-numeric text, in which case a text sort will occur (e.g. "10" is before "3"). The templates automatically use 01, 02 and 03 as the sorting. To get the desired sort results for other numbers it may be necessary to use the template to specify appropriate sort keys to be inserted as hidden text in front of the displayed values. For example, displays "DQ" but sorts using "9 DQ".

Parameters
The first unnamed parameter can be used to resize the medal image.

Example, 20px high:
 * , will display as:

The parameter defaults to null, which will produce a medal of the image's native size (16px high and 16px wide).

The link parameter can be used to pass a link to an article to.

Example:

It defaults to null.

Examples

 * For example, the following code using two digit sorting...



...will display as:


 * Image size of medals may affect row heights if larger than adjacent text...



... too big (left); matching text (right)