Module:Sports results/doc

This Lua-based module is meant to build match result tables. Note that this module is used extensively, so test potential changes rigorously in the sandbox and please ensure consensus exists before implementing major changes. Also note that the module is called from Module:Sports table and check for potential issues there as well after making changes. The rest of this documentation explains how to use this module in an article or template, check the table of contents for specific items.

Wikitext test cases at Module:Sports results/testcases wikitext.

Usage
The template can be used as follows: The main command is, which calls the module and sets the basic structure up. Then you list the order in which the teams are listed as team1, team2, etc for however many teams you need in the table. If you set showteam to a team, then that team's results are highlighted as in the example. The display of team names for team TTT is now governed by name_TTT and short_TTT for the row and column headers respectively. The results for the game TTT vs. SSS can now be input by match_TTT_SSS. The table is build this way, future games can be listed with their date or they can be left blank.

The source is controlled by source. The update date can be set by date when the season is active; can be removed after the season with complete and can be set for a future start date by using future and setting the start date with start_date.

The width of the columns can be set by match_col_width.

A note can be added to a result using match_TTT_SSS_note.

Another example is:

Win/Draw/Loss colour
The colour of win/draw/loss colour can be set by FBR.

Team header
To change the default  team header, use team_header.

Two legs
For two matches per team pair, use 2 and match1_AAA_BBB / match2_AAA_BBB instead of match_AAA_BBB. For wide tables, use y which provides a more narrow format.

Blank and pivot cells
Pivot cells defaulted to show  (m-dash), but they can be changed to solidly colored cell using code solid_cell where color of the cell could be set by indicating with a phrase (i.e. grey). Also, each individual cell could be made inactive with a phrase null.

Generating a blank table
To generate a blank table, use main where team1, team2, ... are the abbreviations for the team names in the order you wish them to appear. You may include name_... and other parameters as well, and they should be included in the result.