Template:FIFA World Cup group table/doc

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

Usage[edit]

This template builds a FIFA World Cup group table from three parameters:

  • teams — a list of the names of the countries, one per line with no padding spaces before or after each.
  • icons — optionally, icons for the countries, also one per line with no padding spaces. Either provide all of them, or none.
  • games — outcomes of games, one per line, in the format
team1 score1 score2 team2
where each pair of consecutive fields must be separated by two or more spaces. The teams must be listed in the teams parameter and the scores must be numbers.

For example,

{{FIFA World Cup group table
|teams=
Carpathia
Upper Carpathia
Narnia
Fred
|games=
Carpathia        1  1  Fred
Upper Carpathia  5  3  Narnia
Fred             3  2  Upper Carpathia
}}

would produce

Country Played Won Draw Loss Goals
for
Goals
against
Goal
diff
Pts
Carpathia 1 0 1 0 1 1 0 1
Upper Carpathia 2 1 0 1 7 6 1 3
Narnia 1 0 0 1 3 5 -2 0
Fred 2 1 1 0 4 3 1 4

while adding an additional parameter

|icons=
X
Y
Z
T

would produce

Country Played Won Draw Loss Goals
for
Goals
against
Goal
diff
Pts
X Carpathia 1 0 1 0 1 1 0 1
Y Upper Carpathia 2 1 0 1 7 6 1 3
Z Narnia 1 0 0 1 3 5 -2 0
T Fred 2 1 1 0 4 3 1 4

Internals[edit]

Subtemplate {{FIFA World Cup group table/compute}} uses the parameters to compute the entries for the table, and returns a wikilisp data structure containing them. Subtemplate {{FIFA World Cup group table/format}} formats these into a table. The two were separated to make them both easier to read.