Content deleted Content added
more support for single wild card team in text for table header |
remove fixed table width; adjust column percentages; move table title to table caption |
||
Line 54:
default = function(tableHeaderInfo)
return
'{| class="wikitable
.. '|' .. tableHeaderInfo.division .. ']]\
|- \
! width="7%" | [[Win (baseball)|W]]\▼
! width="
! width="6%" | [[Loss (baseball)|L]]\
! width="9%" | [[Winning percentage|Pct.]]\
! width="
! width="10%" | [[Home (sports)|Home]]\
! width="10%" | [[Road (sports)|Road]]\
Line 68 ⟶ 70:
winLossOnly = function(tableHeaderInfo)
return
'{| class="wikitable
|- \
! width="66%" | Team\
! width="10%" | [[Win (baseball)|W]]\
! width="10%" | [[Loss (baseball)|L]]\
Line 78 ⟶ 82:
wildCard2012 = function(tableHeaderInfo)
return
'{| class="wikitable
|- \
! width="64%" | Team \
! width="8%" | [[Win (baseball)|W]]\
! width="8%" | [[Loss (baseball)|L]]\
! width="
! width="
'
end, -- function generateTableHeader.wildCard2012
Line 95 ⟶ 101:
end
return
'{| class="wikitable
' for postseason)</small>\
|- \
! width="64%" | Team \
! width="8%" | [[Win (baseball)|W]]\
! width="8%" | [[Loss (baseball)|L]]\
! width="
! width="
'
end, -- function generateTableHeader.wildCard
Line 115 ⟶ 123:
|| ' .. teamRowInfo.winningPercentage .. '\
|| ' .. teamRowInfo.gamesBehind .. '\
|| ' .. teamInfo.homeWins .. '‍–‍' .. teamInfo.homeLosses ..'\
|| ' .. teamInfo.roadWins .. '‍–‍' .. teamInfo.roadLosses .. '\n'
end, -- function generateTeamRow.default()
Line 325 ⟶ 333:
for idx, teamInfo in ipairs(listOfTeams) do
local winningPercentage = string.format(
'%.3f', teamInfo.wins / ( teamInfo.wins + teamInfo.losses )▼
winningPercentage = string.gsub(winningPercentage, '^0', '')
local teamRowInfo = {
teamSeasonPage = year .. ' ' .. teamInfo.teamLink .. ' season',
winningPercentage =
▲ '%.3f', teamInfo.wins / ( teamInfo.wins + teamInfo.losses )
▲ ),
gamesBehind = '',
seedText = '',
Line 362 ⟶ 372:
if (seedInfo[teamInfo.name] ~= nil) then
teamRowInfo.seedText = '<sup>(' .. seedInfo[teamInfo.name] .. ')</sup>
teamRowInfo.rowStyle = ' style="background:#CCFFCC"'
end
|