Module:Sandbox/S.A. Julio
Appearance
local p = {}
function p.generateTable(frame)
local args = frame:getParent().args
local wikitable = '{| class="wikitable" style="text-align:center"\n'
wikitable = wikitable .. '|-\n'
wikitable = wikitable .. '! style="text-align:right; width:250px"|Team 1\n'
wikitable = wikitable .. '! style="width:80px"|{{Abbrlink|Agg.|Aggregate score}}\n'
wikitable = wikitable .. '! style="text-align:left; width:250px"|Team 2\n'
wikitable = wikitable .. '! style="width:80px"|1st leg\n'
wikitable = wikitable .. '! style="width:80px"|2nd leg\n'
local i = 1
while args[i] do
local team1 = args[i] or ""
local team1Icon = args[i + 1] or ""
local aggregateScore = args[i + 2] or ""
local team2 = args[i + 3] or ""
local team2Icon = args[i + 4] or ""
local firstLeg = args[i + 5] or ""
local secondLeg = args[i + 6] or ""
wikitable = wikitable .. '|-\n'
wikitable = wikitable .. '|style="text-align: right;"|' .. team1 .. ' {{fbaicon|' .. team1Icon .. '|variant=}}\n'
wikitable = wikitable .. '|style="text-align: center;"|' .. aggregateScore .. '\n'
wikitable = wikitable .. '|style="text-align: left;"|{{fbaicon|' .. team2Icon .. '|variant=}} ' .. team2 .. '\n'
wikitable = wikitable .. '|style="text-align: center;"|' .. firstLeg .. '\n'
wikitable = wikitable .. '|style="text-align: center;"|' .. secondLeg .. '\n'
i = i + 7
end
wikitable = wikitable .. '|}\n'
return wikitable
end
return p