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.
Updated to match(es) played on 1 January 1900. Source: Wikipedia Notes:
^Match awarded to FIFA World Cup Dream Team with a 1–0 score.
The main command is {{#invoke:Sports results|main}}, 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 |update=date when the season is active; can be removed after the season with |update=complete and can be set for a future start date by using |update=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:
What you type
{{#invoke:Sports results|main
|team1=CZE |team2=ISL |team3=KAZ |team4=LVA |team5=NED |team6=TUR
|name_CZE={{fb-rt|CZE}} |short_CZE={{flagicon|CZE}}
|name_ISL={{fb-rt|ISL}} |short_ISL={{flagicon|ISL}}
|name_KAZ={{fb-rt|KAZ}} |short_KAZ={{flagicon|KAZ}}
|name_LVA={{fb-rt|LVA}} |short_LVA={{flagicon|LVA}}
|name_NED={{fb-rt|NED}} |short_NED={{flagicon|NED}}
|name_TUR={{fb-rt|TUR}} |short_TUR={{flagicon|TUR}}
|match_CZE_ISL=[[UEFA Euro 2016 qualifying Group A#Czech Republic v Iceland|<small>16 Nov '14</small>]]
|match_CZE_KAZ=[[UEFA Euro 2016 qualifying Group A#Czech Republic v Kazakhstan|<small>3 Sep '15</small>]]
|match_CZE_LVA=[[UEFA Euro 2016 qualifying Group A#Czech Republic v Latvia|<small>28 Mar '15</small>]]
|match_CZE_NED=[[UEFA Euro 2016 qualifying Group A#Czech Republic v Netherlands|2–1]]
|match_CZE_TUR=[[UEFA Euro 2016 qualifying Group A#Czech Republic v Turkey|<small>10 Oct '15</small>]]
|match_ISL_CZE=[[UEFA Euro 2016 qualifying Group A#Iceland v Czech Republic|<small>12 Jun '15</small>]]
|match_ISL_KAZ=[[UEFA Euro 2016 qualifying Group A#Iceland v Kazakhstan|<small>6 Sep '15</small>]]
|match_ISL_LVA=[[UEFA Euro 2016 qualifying Group A#Iceland v Latvia|<small>10 Oct '15</small>]]
|match_ISL_NED=[[UEFA Euro 2016 qualifying Group A#Iceland v Netherlands|2–0]]
|match_ISL_TUR=[[UEFA Euro 2016 qualifying Group A#Iceland v Turkey|3–0]]
|match_KAZ_CZE=[[UEFA Euro 2016 qualifying Group A#Kazakhstan v Czech Republic|2–4]]
|match_KAZ_ISL=[[UEFA Euro 2016 qualifying Group A#Kazakhstan v Iceland|<small>28 Mar '15</small>]]
|match_KAZ_LVA=[[UEFA Euro 2016 qualifying Group A#Kazakhstan v Latvia|0–0]]
|match_KAZ_NED=[[UEFA Euro 2016 qualifying Group A#Kazakhstan v Netherlands|<small>10 Oct '15</small>]]
|match_KAZ_TUR=[[UEFA Euro 2016 qualifying Group A#Kazakhstan v Turkey|<small>12 Jun '15</small>]]
|match_LVA_CZE=[[UEFA Euro 2016 qualifying Group A#Latvia v Czech Republic|<small>6 Sep '15</small>]]
|match_LVA_ISL=[[UEFA Euro 2016 qualifying Group A#Latvia v Iceland|0–3]]
|match_LVA_KAZ=[[UEFA Euro 2016 qualifying Group A#Latvia v Kazakhstan|<small>13 Oct '15</small>]]
|match_LVA_NED=[[UEFA Euro 2016 qualifying Group A#Latvia v Netherlands|<small>12 Jun '15</small>]]
|match_LVA_TUR=[[UEFA Euro 2016 qualifying Group A#Latvia v Turkey|1–1]]
|match_NED_CZE=[[UEFA Euro 2016 qualifying Group A#Netherlands v Czech Republic|<small>13 Oct '15</small>]]
|match_NED_ISL=[[UEFA Euro 2016 qualifying Group A#Netherlands v Iceland|<small>3 Sep '15</small>]]
|match_NED_KAZ=[[UEFA Euro 2016 qualifying Group A#Netherlands v Kazakhstan|3–1]]
|match_NED_LVA=[[UEFA Euro 2016 qualifying Group A#Netherlands v Latvia|<small>16 Nov '14</small>]]
|match_NED_TUR=[[UEFA Euro 2016 qualifying Group A#Netherlands v Turkey|<small>28 Mar '15</small>]]
|match_TUR_CZE=[[UEFA Euro 2016 qualifying Group A#Turkey v Czech Republic|1–2]]
|match_TUR_ISL=[[UEFA Euro 2016 qualifying Group A#Turkey v Iceland|<small>13 Oct '15</small>]]
|match_TUR_KAZ=[[UEFA Euro 2016 qualifying Group A#Turkey v Kazakhstan|<small>16 Nov '14</small>]]
|match_TUR_LVA=[[UEFA Euro 2016 qualifying Group A#Turkey v Latvia|<small>3 Sep '15</small>]]
|match_TUR_NED=[[UEFA Euro 2016 qualifying Group A#Turkey v Netherlands|<small>6 Sep '15</small>]]
}}
Updated to match(es) played on 22 April 2018. Source: Legend: Blue = home team win; Yellow = draw; Red = away team win.
Team header
To change the default Home \ Away team header, use |team_header=.
Two legs
For two matches per team pair, use |legs=2 and |match1_AAA_BBB= / |match2_AAA_BBB= instead of |match_AAA_BBB=. For wide tables, use |multirowlegs=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.
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.
-- Module to build results cross-tables for standings in Sports-- See documentation for detailsrequire('strict')localp={}-- Main functionfunctionp.main(frame)-- Get the args, stripping out blank valueslocalgetArgs=require('Module:Arguments').getArgslocalArgs=getArgs(frame,{parentFirst=true})-- Exit early if we are using section transclusion for a different sectionlocaltsection=frame:getParent().args['transcludesection']orframe:getParent().args['section']or''localbsection=frame.args['section']or''if(tsection~=''andbsection~='')thenif(tsection~=bsection)thenreturn''endend-- Declare localslocalt={}localt_footer={}localt_return={}localteam_list={}localnotes_exist=falselocalii,ii_fw,bg_col,team_name,team_code_ii,ii_start,ii_end-- Optional custom team headerlocalteam_header=Args['team_header']or'Home \\ Away'-- Number of legslocallegs=tonumber(Args['legs'])or1localmultirowlegs=(Args['multirowlegs']or'no')~='no'-- Edit links if requestedlocalbaselink=frame:getParent():getTitle()ifmw.title.getCurrentTitle().fullText==baselinkthenbaselink=''endlocaltemplate_name=Args['template_name']or(baselink~=''and(':'..baselink))or''localedit_links=template_name==''and''orrequire('Module:Navbar')._navbar({template_name,mini=1,style='float:right'})-- Get the custom start point for the table (most will start by default at 1)localtop_pos=tonumber(Args['highest_pos'])or1-- Get the custom end point for the table (unrestricted if bottom_pos is < top_pos)localbottom_pos=tonumber(Args['lowest_pos'])or0localN_teams=top_pos-1-- Default to 0 at start, but higher number needed to skip certain entries-- Load some other moduleslocalp_sub=require('Module:Sports table/sub')-- Alternative syntax for team listifArgs['team_order']andArgs['team_order']~=''thenlocaltlist=mw.text.split(Args['team_order'],'%s*[;,]%s*')fork,tnameinipairs(tlist)doiftname~=''thenArgs['team'..k]=tnameendendendifArgs['team_header_note']thennotes_exist=truelocalnote_string=frame:expandTemplate{title='efn',args={group='lower-alpha',Args['team_header_note']}}team_header=team_header..note_stringend-- Read in number of consecutive teams (ignore entries after skipping a spot)ii_start=N_teamswhileArgs['team'..N_teams+1]~=niland(bottom_pos<top_posorN_teams<bottom_pos)doN_teams=N_teams+1-- Sneakily add it twice to the team_list parameter, once for the actual-- ranking, the second for position lookup in sub-tables-- This is possible because Lua allows both numbers and strings as indices.team_list[N_teams]=Args['team'..N_teams]-- i^th entry is team Xteam_list[Args['team'..N_teams]]=N_teams-- team X entry is position iendii_end=N_teams-- Get team to showlocalii_show=team_list[Args['showteam']]-- nil if non-existant-- Set the font sizelocalfont_size=Args['font_size']or'100%'-- Create header-- Open tabletable.insert(t,'{|class="wikitable plainrowheaders" style="text-align:center;font-size:'..font_size..';"\n')-- Table titleifArgs['title']thentable.insert(t,'|+ '..Args['title']..'\n')end-- First columnt_return.count=0-- Dummy parameter, using subfunction call seems best at this point because both module are intertwinedt_return.tab_text=t-- Actual textt_return=p_sub.colhead(t_return,'auto',edit_links..' '..team_header)-- Other columns passed to subfunctiont_return=p.header(t_return,Args,p_sub,N_teams,team_list,legs,multirowlegs)t=t_return.tab_text-- Random value used for uniquenessmath.randomseed(os.clock()*10^8)localrand_val=math.random()localnote_string,note_idlocalnote_id_list={}-- Now create individual rowsii_start=tonumber(Args['highest_row'])and(tonumber(Args['highest_row'])>top_pos)andtonumber(Args['highest_row'])ortop_posii_end=tonumber(Args['lowest_row'])and(tonumber(Args['lowest_row'])<N_teams)andtonumber(Args['lowest_row'])orN_teamsforii=ii_start,ii_enddo-- Get team infoteam_code_ii=team_list[ii]team_name=Args['name_'..team_code_ii]orteam_code_iilocalii_style='text-align:'..(Args['team_align']or'right')..';'..(iiandii==ii_showand'font-weight:bold;'or'')..(Args['team_nowrap']and'white-space:nowrap;'or'')localteam_note=Args['note_'..team_code_ii]ifteam_notethennotes_exist=true-- Only when it exist-- First check for existence of reference for noteifnotArgs['note_'..team_note]then-- It's the entry-- Add random end for unique ID if more tables are present on article (which might otherwise share an ID)note_id='"table_note_'..team_code_ii..rand_val..'"'note_id_list[team_code_ii]=note_idnote_string=frame:expandTemplate{title='efn',args={group='lower-alpha',name=note_id,team_note}}else-- Check for existence elsewherelocalnote_local_num=team_list[team_note]orii_end+1ifnote_id_list[team_note]or((note_local_num>=ii_start)and(note_local_num<=ii_end))then-- It existsnote_id='"table_note_'..team_note..rand_val..'"'-- Identifiernote_string=frame:extensionTag{name='ref',args={group='lower-alpha',name=note_id}}else-- Now define the identifier for this-- Add random end for unique IDnote_id='"table_note_'..team_note..rand_val..'"'note_id_list[team_note]=note_idnote_string=frame:expandTemplate{title='efn',args={group='lower-alpha',name=note_id,Args['note_'..team_note]}}endend-- Now append this to the team_name stringteam_name=team_name..note_stringend-- Team namestable.insert(t,'|- \n')-- New rowtable.insert(t,'! scope="row"'..(multirowlegsand' rowspan='..legsor'')..'style="'..ii_style..'"| '..team_name..'\n')-- Position number-- Now include note to match results if neededforjj=top_pos,N_teamsdolocalteam_code_jj=team_list[jj]ifii==jjthen-- Nothingelseforl=1,legsdolocalm=(legs==1)and'match_'or'match'..l..'_'localmatch_note=Args[m..team_code_ii..'_'..team_code_jj..'_note']ifmatch_notethennotes_exist=true-- Only when it exist-- First check for existence of reference for noteifnot(Args['note_'..match_note]orArgs[m..match_note..'_note'])then-- It's the entry-- Add random end for unique ID if more tables are present on article (which might otherwise share an ID)note_id='"table_note_'..l.."_"..team_code_ii..'_'..team_code_jj..rand_val..'"'note_id_list[team_code_ii..'_'..team_code_jj]=note_idnote_string=frame:expandTemplate{title='efn',args={group='lower-alpha',name=note_id,match_note}}else-- Check for existence elsewherelocalnote_local_num=team_list[match_note]orii_end+1ifnote_id_list[match_note]then-- Referencing an existing notenote_id=note_id_list[match_note]-- Borrow the existing identifiernote_string=frame:extensionTag{name='ref',args={group='lower-alpha',name=note_id}}elseif(note_local_num>=ii_start)and(note_local_num<=ii_end)then-- Referencing a player note from a match note. In this case, we remove the leg partnote_id='"table_note_'..match_note..rand_val..'"'note_string=frame:extensionTag{name='ref',args={group='lower-alpha',name=note_id}}else-- Referencing a different match note before its defined with its contentnote_id='"table_note_'..l.."_"..match_note..rand_val..'"'note_id_list[match_note]=note_idnote_string=frame:expandTemplate{title='efn',args={group='lower-alpha',name=note_id,Args['note_'..match_note]}}endend-- Now append this to the match result stringArgs[m..team_code_ii..'_'..team_code_jj]=(Args[m..team_code_ii..'_'..team_code_jj]or'–')..note_stringendendendend-- Then individual resultst=p.row(t,Args,N_teams,team_list,ii,ii_show,legs,multirowlegs)end-- Close tabletable.insert(t,'|}\n')-- Get info for footerlocalupdate=Args['update']or'unknown'localstart_date=Args['start_date']or'unknown'localsource=Args['source']orframe:expandTemplate{title='citation needed',args={reason='No source parameter defined',date=os.date('%B %Y')}}-- Create footer text-- Date updatingifstring.lower(update)=='complete'then-- Do nothingelseifupdate==''then-- Empty parametertable.insert(t_footer,'Updated to match(es) played on unknown. ')elseifstring.lower(update)=='future'then-- Future start datetable.insert(t_footer,'First match(es) will be played: '..start_date..'. ')elsetable.insert(t_footer,'Updated to match(es) played on '..update..'. ')endtable.insert(t_footer,'Source: '..source)if(Args['matches_style']or'')=='FBR'thentable.insert(t_footer,Args['team_header']and'<br />Legend: Blue = left column team win; Yellow = draw; Red = top row team win.'or'<br />Legend: Blue = home team win; Yellow = draw; Red = away team win.')elseif(Args['matches_style']or'')=='BSR'thentable.insert(t_footer,Args['team_header']and'<br />Legend: Blue = left column team win; Red = top row team win.'or'<br />Legend: Blue = home team win; Red = away team win.')endifArgs['a_note']thentable.insert(t_footer,'<br />For upcoming matches, an "a" indicates there is an article about the rivalry between the two participants.')endifArgs['ot_note']thentable.insert(t_footer,'<br />Matches with lighter background shading were decided after overtime.')endlocaltemplatestyles=frame:extensionTag{name='templatestyles',args={src='Module:Sports results/styles.css'}}-- Add notes (if applicable)ifnotes_existthentable.insert(t_footer,'<br>Notes:')t_footer=templatestyles..'<div class="sports-results-notes">'..table.concat(t_footer)..'</div>'t_footer=t_footer..frame:expandTemplate{title='notelist',args={group='lower-alpha'}}elset_footer=templatestyles..'<div class="sports-results-notes">'..table.concat(t_footer)..'</div>'end-- Add footer to main text tabletable.insert(t,t_footer)-- Rewrite anchor linksfork=1,#tdoift[k]:match('%[%[#[^%[%]]*%|')thent[k]=mw.ustring.gsub(t[k],'(%[%[)(#[^%[%]]*%|)','%1'..baselink..'%2')endendreturn'<div style="overflow:hidden">'..'<div class="noresize overflowbugx" style="overflow:auto">\n'..table.concat(t)..'</div></div>'end-- Other functionslocalfunctionget_short_name(s,t,n,ss)-- return short name if definedifsands~=''thenreturnsend-- deflag if necessaryifssandnthenifss=='noflag'thenn=mw.ustring.gsub(n,'%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*%]%]','')n=mw.ustring.gsub(n,'^%s* %s*','')elseifss=='flag'thenn=mw.ustring.gsub(n,'(<span class="flagicon">%s*%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*link=)[^%|%[%]]*(%]%][^<>]*</span>)%s*%[%[([^%[%]%|]*)%|[^%[%]]*%]%]','%1%3%2')n=mw.ustring.gsub(n,'(%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*link=)[^%|%[%]]*(%]%])%s* %s*%[%[([^%[%]%|]*)%|[^%[%]]*%]%]','%1%3%2')n=mw.ustring.gsub(n,'(%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*link=)[^%|%[%]]*(%]%])%s*%[%[([^%[%]%|]*)%|[^%[%]]*%]%]','%1%3%2')n=mw.ustring.gsub(n,'.*(<span class="flagicon">%s*%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*%]%][^<>]*</span>).*','%1')n=mw.ustring.gsub(n,'.*(%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*%]%]).*','%1')n=mw.ustring.gsub(n,' (</span>)','%1')endend-- replace link text in name with team abbr if possibleifnandtandn:match('(%[%[[^%[%]]*%]%])')thenn=mw.ustring.gsub(n,'(%[%[[^%|%]]*%|)[^%|%]]*(%]%])','%1'..t..'%2')n=mw.ustring.gsub(n,'(%[%[[^%|%]]*)(%]%])','%1|'..t..'%2')n=mw.ustring.gsub(n,'(%[%[[^%|%]]*%|)([A-Z][A-Z][A-Z])(%]%]) <span[^<>]*>%([A-Z][A-Z][A-Z]%)</span>','%1%2%3')returnnend-- nothing worked, so just return the unlinked team abbrreturntor''endlocalfunctionget_score_background(s,c)locals1,s2-- Define the colouringlocalwc,lc,tcifc=='level2'thenwc,lc,tc='#CCF9FF','#FCC','#FFC'-- blue2, red2, yellow2elseifc=='level3'thenwc,lc,tc='#DDFCFF','#FDD','#FFD'-- blue3, red3, yellow3elseifc=='level4'thenwc,lc,tc='#EEFFFF','#FEE','#FFE'-- blue4, red4, yellow4elsewc,lc,tc='#BBF3FF','#FBB','#FFB'-- blue1, red1, yellow1end-- check for overrideifs:match('^%s*<span%s+style%s*=["\'%s]*background[%-colr]*%s*:([^\'";<>]*).-$')thenlocalc=mw.ustring.gsub(s,'^%s*<span%s+style%s*=["\'%s]*background[%-colr]*%s*:([^\'";<>]*).-$','%1')return'background: '..c..';'end-- delink if necessaryifs:match('^%s*%[%[[^%[%]]*%|([^%[%]]*)%]%]')thens=s:match('^%s*%[%[[^%[%]]*%|([^%[%]]*)%]%]')endifs:match('^%s*%[[^%[%]%s]*%s([^%[%]]*)%]')thens=s:match('^%s*%[[^%[%]%s]*%s([^%[%]]*)%]')endifs:match('<span[^<>]*>(.-)</span>')thens=s:match('<span[^<>]*>(.-)</span>')end-- get the scoress1=tonumber(mw.ustring.gsub(sor'','^%s*([%d%.]+)%s*–%s*([%d%.]+).*','%1')or'')or''s2=tonumber(mw.ustring.gsub(sor'','^%s*([%d%.]+)%s*–%s*([%d%.]+).*','%2')or'')or''-- return colouring if possibleifs1~=''ands2~=''thenreturn(s1>s2)and('background: '..wc..';')or((s2>s1)and('background: '..lc..';')or('background: '..tc..';'))elsereturn''endendlocalfunctionformat_score(s)s=mw.ustring.gsub(sor'','^%s*([%d%.]+)%s*[–−—%-]%s*([%d%.]+)','%1–%2')s=mw.ustring.gsub(s,'^%s*([%d%.]+)%s*&[MmNn][Dd][Aa][Ss][Hh];%s*([%d%.]+)','%1–%2')s=mw.ustring.gsub(s,'^%s*(%[%[[^%[%]]*%|[%d%.]+)%s*%-%s*([%d%.]+)','%1–%2')s=mw.ustring.gsub(s,'^%s*(%[[^%[%]%s]*%s+[%d%.]+)%s*%-%s*([%d%.]+)','%1–%2')s=mw.ustring.gsub(s,'^%s*(%[%[[^%[%]]*%|[%d%.]+)%s*&[MmNn][Dd][Aa][Ss][Hh];%s*([%d%.]+)','%1–%2')s=mw.ustring.gsub(s,'^%s*(%[[^%[%]%s]*%s+[%d%.]+)%s*&[MmNn][Dd][Aa][Ss][Hh];%s*([%d%.]+)','%1–%2')returnsendfunctionp.header(tt,Args,p_sub,N_teams,team_list,legs,multirowlegs)localii,team_code_ii,short_namelegs=legsor1-- Set match column widthlocalcol_width=Args['match_col_width']or'28'-- Get some default values in case it doesn't start at 1localtop_pos=tonumber(Args['highest_pos'])or1forl=1,legsdoifmultirowlegsandl>1thenbreakendforii=top_pos,N_teamsdoteam_code_ii=team_list[ii]short_name=get_short_name(Args['short_'..team_code_ii],team_code_ii,Args['name_'..team_code_ii],Args['short_style']or'')localbl=legs>1andii==top_posand' style="border-left:2px solid #aaa;"'or''tt=p_sub.colhead(tt,col_width..bl,short_name)endendreturnttendfunctionp.row(tt,Args,N_teams,team_list,ii,ii_show,legs,multirowlegs)-- Note ii is the row number being shownlocaljj,fw,bg,result,result_extra,team_code_ii,team_code_jjlegs=legsor1-- Set score cell stylelocalmatches_style=Args['matches_style']or''team_code_ii=team_list[ii]-- Get some default values in case it doesn't start at 1localtop_pos=tonumber(Args['highest_pos'])or1forl=1,legsdoifmultirowlegsandl>1thentable.insert(tt,'|- \n')-- New rowendforjj=top_pos,N_teamsdoteam_code_jj=team_list[jj]localm=(legs==1)and'match_'or'match'..l..'_'result=Args[m..team_code_ii..'_'..team_code_jj]or''result_extra=Args['result_'..team_code_ii..'_'..team_code_jj]or''localbl=legs>1andjj==top_posand'border-left:2px solid #aaa;'or''ifii==jjorresult=='null'then-- Solid cellfw='font-weight:'..(ii==ii_showand'bold'or'normal')..';'bg=''-- Grey background color for solid cellifArgs['solid_cell']=='grey'thentable.insert(tt,'| style="'..fw..bl..'background:#bbb;" |\n')elsetable.insert(tt,'| style="'..fw..bl..bg..'" | —\n')endelse-- Content cell-- Set bolding and backgroundfw='font-weight:'..((ii==ii_showorjj==ii_show)and'bold'or'normal')..';'bg=''-- Reformat dashesifresult~=''thenresult=format_score(result)end-- Background coloring if enabledifmatches_style=='FBR'andresult~=''thenifresult_extra=='OT'thenbg=get_score_background(result,'level2')elseifresult_extra=='PK'thenbg=get_score_background(result,'level3')elsebg=get_score_background(result,'')endelseifmatches_style=='BSR'andresult~=''thenifresult_extra=='OT'thenbg=get_score_background(result,'level3')elseifresult_extra=='OTL'thenbg=get_score_background('0–1','level3')elseifresult_extra=='OTW'thenbg=get_score_background('1–0','level3')elseifresult_extra=='L'thenbg=get_score_background('0–1','')elseifresult_extra=='W'thenbg=get_score_background('1–0','')elsebg=get_score_background(result,'')endendtable.insert(tt,'| style="white-space:nowrap;'..fw..bl..bg..'" |'..result..'\n')endendendreturnttendreturnp