local getArgs = require('Module:Arguments').getArgs
local getSkillIcon = require("Module:FGOSkillIcon").getSkillIcon
local p = {}
function p.main(frame)
args = getArgs(frame:getParent())
argCount = 0
for _, _ in pairs(args) do argCount = argCount + 1 end
if argCount % 4 ~= 0 then
return '<strong class="error">参数的数量应是4的倍数</strong>'
end
local out = {}
table.insert(out, '<table class="wikitable" style="text-align:center;width:785px;max-width:100%">')
for i = 1, argCount / 4 do
table.insert(out, '<tr><th scope="row" rowspan=2 width="60px">' .. getSkillIcon(args[i*4-3]) .. '</th>')
table.insert(out, '<th scope="col">' .. args[i*4-2] .. ' ' .. args[i*4-1] .. '</th></tr>')
table.insert(out, '<tr><td>' .. args[i*4] .. '</td></tr>')
end
table.insert(out, '</table>')
return table.concat(out)
end
return p