Module:Infobox
Appearance
Documentation for this module may be created at Module:Infobox/doc
local p = {}
p.order = {}
p.map = {}
function p.add_section(name, fields)
table.insert(p.order, name)
map[name] = fields
end
function p.infobox(frame)
local args = frame:getParent().args
local out = {}
table.insert(out, '{| class="infobox" style="width: 250px;"')
if args.title then
table.insert(out, '|-\n! colspan="2" style="font-size:120%; background:#ccc;" | ' .. args.title)
end
for i, name in ipairs(p.order) do
table.insert(out, '|-\n! colspan="2" style="background: #F4BB44;" | ' .. args['section' .. i])
for j, field in ipairs(p.map[name]) do
table.insert(out, '|-\n| ' .. label .. ' || ' .. data)
end
end
table.insert(out, '|}')
return table.concat(out, '\n')
end
return p