Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sports table/Custom/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Usage == ===Basic usage=== In its simplest form only several parameters need to be used to build a table. {| class="wikitable" style="background:white;" |- |'''What you type''' |<syntaxhighlight lang=moin>{{#invoke:Sports table|main|style=Custom |num_cols=6 |colstyle2=win |col_header4={{Abbr|Ex|Example header}} |default_value5=— |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }}</syntaxhighlight> |- |'''What it looks like''' |{{#invoke:Sports table|main|style=Custom |num_cols=6 |colstyle2=win |col_header4={{Abbr|Ex|Example header}} |default_value5=— |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }} |} The main command is the <code><nowiki>{{#invoke:Sports table|main|style=Custom}}</nowiki></code> statement which basically calls the module and enables you to set everything up. You also need to set the {{para|num_cols}} parameter to determine how many columns will be displayed after the team column. If this is not set, then there will be one column after the team column. For each column you now define the column style and/or column header by using {{para|colstyleN}} and {{para|col_headerN}} respectively (with N replaced by the column number). For more information on column styles, see [[#Column styles]]. To set the order and number of rows, you list the positions of the teams as {{para|team1}}, {{para|team2}}, etc for however many teams you need in the table. You can use full team names there <u>without spaces</u> if you want, but using codes (as in the example) can make it easier. For each team you now define the wins, draws, losses, and values contained in column number N by using {{para|win_TTT}}, {{para|draw_TTT}}, {{para|loss_TTT}} and {{para|colN_TTT}} respectively (with TTT replaced by the team code). If you do not define these numbers, it is automatically assumed to be <code>&nbsp;&nbsp;</code>, except for columns which use a column style or have defined {{para|default_valueN}}. It is good practice though to include them anyway and to align the columns using appropriate spaces (as in the example), so the code is easy to read. The last step now is to define the {{para|name_TTT}} parameters which determine what name is shown in the table, you can use wiki markup and templates in here as well. See [[#Dating]] to see how to change the update date. ===Ranking column=== One of the columns should always be a ranking column. This column may be chosen by a parameter. {| class="wikitable" style="background:white;" |- |'''What you type''' |<syntaxhighlight lang=moin>{{#invoke:Sports table|main|style=Custom |num_cols=6 |ranking_col=2 |colstyle2=win |col_header4={{Abbr|Ex|Example header}} |default_value5=— |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }}</syntaxhighlight> |- |'''What it looks like''' |{{#invoke:Sports table|main|style=Custom |num_cols=6 |ranking_col=2 |colstyle2=win |col_header4={{Abbr|Ex|Example header}} |default_value5=— |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }} |} The {{para|ranking_col}} parameter selects which parameter is the ranking column. This column will be bolded and any head-to-head notes will be applied to the content of cells in this column. See [[#Notes]] for more information on head-to-head notes. By default, the ranking column is the last column. If you do not want any column to be the ranking column, use {{para|ranking_col|0}}. Note that in this case you should not define any head-to-head notes, because they will not be displayed. ===Column styles=== It is very useful to set column styles in these tables {| class="wikitable" style="background:white;" |- |'''What you type''' |<syntaxhighlight lang=moin>{{#invoke:Sports table|main|style=Custom |num_cols=8 |colstyle1=pld |colstyle2=win |colstyle3=draw |default_value3=— |colstyle4=loss |colstyle5=points |colstyle6=points |colstyle7=ppg |colstyle8=sum_ppg_col6 |winpoints=2 |drawpoints=1 |losspoints=-0.1 |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }}</syntaxhighlight> |- |'''What it looks like''' |{{#invoke:Sports table|main|style=Custom |num_cols=8 |colstyle1=pld |colstyle2=win |colstyle3=draw |default_value3=— |colstyle4=loss |colstyle5=points |colstyle6=points |colstyle7=ppg |colstyle8=sum_ppg_col6 |winpoints=2 |drawpoints=1 |losspoints=-0.1 |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }} |} Note that in this table, even though {{para|default_value3|&mdash;}} an [[Em-dash]] is not displayed when draw data is not given. This is because the default value set by the column style supersedes any manually entered default value. However column 6 shows that data entered manually via {{para|col6_TTT}} supersedes the column style data. This example shows multiple relevant column styles ====pld, played, match, or matches==== If the column style is set to one of these values, then the default value of a cell is calculated by adding up {{para|win_TTT}} plus {{para|draw_TTT}} plus {{para|loss_TTT}}, each of whose default values are 0. The column header is <code><abbr title="Played">Pld</abbr></code>, but may be changed using {{para|pld_header}}. ====w, win, or wins==== If the column style is set to one of these values, then the default value of a cell is the value of {{para|win_TTT}} or 0 if no such value is given. The column header is <code><abbr title="Won">W</abbr></code>. ====d, draw, or draws==== If the column style is set to one of these values, then the default value of a cell is the value of {{para|draw_TTT}} or 0 if no such value is given. The column header is <code><abbr title="Drawn">D</abbr></code>. For backwards compatibility with the WDL style, if {{para|use_tie}} is set to yes, then the header is <code><abbr title="Tied">T</abbr></code>, and in either case, the header may be changed using {{para|draw_header}} ====l, loss, or losses==== If the column style is set to one of these values, then the default value of a cell is the value of {{para|loss_TTT}} or 0 if no such value is given. The column header is <code><abbr title="Lost">L</abbr></code>. ====rw==== For backwards compatibility with the WDL style, there is an option for a rounds won column style. If the column style is set to this value, then the default value of a cell is the value of {{para|rw_TTT}} or 0 if no such value is given. The column header is <code><abbr title="Rounds won">RW</abbr></code>, but may be changed using {{para|rw_header}}. ====pts or points==== If the column style is set to one of these values, then the default value of a cell is the number of points obtained by adding up the appropriate values for the wins, draws, losses, and rounds won. As a default a win is worth 3 points, a draw 1 point, a loss 0 points, and a round won 1 point. These values can be overwritten to what you need by {{para|winpoints}}, {{para|drawpoints}}, {{para|losspoints}} and {{para|rwpoints}}. The column header is <code><abbr title="Points">Pts</abbr></code>. ====ppg==== If the column style is set to this value, then the default value of a cell is the points as calculated above divided by the number of matches as calculated above. Even if these values have been overridden by {{para|colN_TTT}}, the calculated value is used and not the input value. The column header is <code><abbr title="Points per game">PPG</abbr></code>. A column with the ppg style will be slightly wider than the default column width. ====ppga==== It means "ppg average"; same as ppg but the value gives three decimal places. ====sum_S_T or diff_S_T==== If the column style is set to one of these values, with S and T replaced by non-mathematical column styles, then the value of a cell will be the mathematical result of the chosen operation on the values determined by the column styles specified by S and T. Note that if entries for S or T are not defined, then a default value of 0 is set, even if they are present in a column with a different default value. A mathematical style does not alter the column header from the default. The parameter {{para|plus_sign_diffs}} determines whether a plus sign is shown on differences that are positive. By default this value is set to {{para|plus_sign_diffs|no}}. ====other==== Any other column style will not set a default value, and so the default cell value set by {{para|default_valueN}} will be used. If the column style is set to such a value other than those listed above which is at most 3 characters long, then the column header is a fully uppercase version of the column style. For example, if the column style is set to cs, then the column header is <code>CS</code>. However, if the column style is set to a value other than those listed above that is longer than 3 characters, no alteration to the header will be made. For example, if the 2nd column style is set to cscs, then the column header is <code><abbr title="Column 2">2</abbr></code>. Additionally, if the column style is set to a value other than those listed above, then input may be taken from a parameter given by the column style underscore TTT. For example, if the column style is set to cs, then input may be taken via {{para|cs_TTT}} in addition to the usual {{para|colN_TTT}}. Currently, custom column styles should only contain alphanumeric characters. The results of anything else are '''undefined'''. ===Default styles=== If you wish to set the column style of multiple columns at once to imitate a different style of the Sports table module, then this may be done using the {{para|default_style}} parameter. {| class="wikitable" style="background:white;" |- |'''What you type''' |<syntaxhighlight lang=moin>{{#invoke:Sports table|main|style=Custom |default_style=WDLbasic |num_cols=6 |colstyle3=W |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }}</syntaxhighlight> |- |'''What it looks like''' |{{#invoke:Sports table|main|style=Custom |default_style=WDLbasic |num_cols=6 |colstyle3=W |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }} |} For backwards compatibility with the WDL style, there are many choices for {{para|default_style}} which produce similar columns to those in the WDL style. Valid choices for this parameter are shown below. If the parameter {{para|num_cols}} is set, this parameter will take precedence over the number of columns given by the default style. If no {{para|ranking_col}} is defined, then the ranking column will be set equal to the pts column. Note that a column style set using {{para|colstyleN}} takes precedence over the column style set by {{para|default_style}}. For backwards compatibility with the WDL style, if using one of these default styles, then parameters {{para|show_win}}, {{para|show_draw}}, {{para|show_loss}}, and {{para|hide_played}} may be used to remove some of these columns, and alter the number of columns accordingly. Additionally, to list losses first, use {{para|loss_before_draw|true}} or {{para|loss_before_tie|true}}. ====WDLbasic==== Column styles are (in order): pld, win, draw, loss, pts ====WLbasic==== Column styles are (in order): pld, win, loss, pts ====WDLgdiff==== Column styles are (in order): pld, win, draw, loss, gf, ga, diff_gf_ga, pts ====WLgdiff==== Column styles are (in order): pld, win, loss, gf, ga, diff_gf_ga, pts ===Customization=== Several things can be customized in these tables ====Bolded columns==== Normally, only the ranking column has bolded entries. This may be customized. {| class="wikitable" style="background:white;" |- |'''What you type''' |<syntaxhighlight lang=moin>{{#invoke:Sports table|main|style=Custom |default_style=WDLbasic |num_cols=6 |bold_col2=yes |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }}</syntaxhighlight> |- |'''What it looks like''' |{{#invoke:Sports table|main|style=Custom |default_style=WDLbasic |num_cols=6 |bold_col2=yes |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }} |} You can set all entries of column number N to be bolded by using {{para|bold_colN|yes}}. Note that if a column style sets a column to be bolded, then there is no way to set that column to a normal font weight. ====Column alignment==== Normally the data in any column (other than the team name column) is placed in the center of the column. This may be customized. {| class="wikitable" style="background:white;" |- |'''What you type''' |<syntaxhighlight lang=moin>{{#invoke:Sports table|main|style=Custom |default_style=WDLbasic |num_cols=6 |aligncol6=r |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }}</syntaxhighlight> |- |'''What it looks like''' |{{#invoke:Sports table|main|style=Custom |default_style=WDLbasic |num_cols=6 |aligncol6=r |team1=FDT |team2=BBB |team3=CCC |team4=DDD |team5=EEE |win_FDT=5 |loss_FDT=0 |col6_FDT=10 |win_BBB=3 |draw_BBB=1 |loss_BBB=1 |col6_BBB= 3 |win_CCC=3 |loss_CCC=2 |col6_CCC= 3 |win_DDD=1 |draw_DDD=1 |loss_DDD=3 |col6_DDD= 1 |win_EEE=0 |loss_EEE=5 |name_FDT=[[FIFA World Cup Dream Team]] |name_BBB=Team 2 |name_CCC=Team 3 |name_DDD=Team 4 |name_EEE={{fb|GIB}} }} |} You can choose the text alignment of column number N by using {{para|aligncolN}}. Note that the column header is always centered. ====Header options==== {| class="wikitable" style="background:white;" |- |'''What you type''' |<syntaxhighlight lang=moin>{{#invoke:Sports table|main|style=Custom |num_cols=2 |colstyle1=w |col_header2=<abbr title="Won after extra time or penalties">W+</abbr> |team_header=Player }}</syntaxhighlight> |- |'''What it looks like''' |{{#invoke:Sports table|main|style=Custom |num_cols=2 |colstyle1=w |col_header2=<abbr title="Won after extra time or penalties">W+</abbr> |team_header=Player }} |} The wording of the Team column can be adjusted using {{para|team_header}}. Similarly, the wording of any given custom column number N can be adjusted by {{para|col_headerN}} and this wording is used instead of any wording set by a column style. {{Module:Sports table/styledoc|style_option=Custom}} <includeonly>{{Sandbox other|| <!-- Categories below this line; interwikis at Wikidata --> [[Category:Sports modules]] }}</includeonly>
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)