Template:Sad/doc

sad (sort and display) can be used in sortable tables (when using wikicode pipe table syntax; see ) to sort by a text and also display it, with options to display more before and after without including it in sorting.
 * Usage:

Makes code to sort a table cell by text while also displaying text in the cell. Other content, for example a reference, can be written after the template without affecting sorting.

There are two optional parameters:

The value of  and   will be displayed respectively before and after text without affecting sorting. Whitespace is stripped from the start and end of  and   but not from text.

Content written right before the template but not before a pipe will be interpreted as cell formatting code and not be displayed. must therefore always be used for content to be displayed before text. Content to be displayed after text can be written either after the template or by using. It is not recommended to use  for references.

The source code of the template as of October 2016 is:

The default behaviour of sorting without a  or a sorting template is to use the whole text of the cell for sorting. This means that if  and   are not used and there is no text after the template then there is no reason to use the template.