Module:IBox

local p = {}

-- Generates a single row function p.row(frame) local args = frame:getParent.args if args.condition ==  then return  end

local tr	if args.class then tr = '' else tr = " " end

local th = mw.html.create('th'):wikitext(args[1]) if args.labelclass then th:addClass(args.labelclass) end

local td = mw.html.create('td'):wikitext(args[2] or args.default) if args.valueclass then td:addClass(args.valueclass) end

return tr..tostring(th)..tostring(td)..' ' end

-- Generates a header function p.header(frame) local args = frame:getParent.args if args.condition ==  then return  end local tr = mw.html.create('tr') :tag('th') :attr('colspan', 2):addClass('mainheader') :wikitext(args[1]):done return tostring(tr) end

-- Generates the ending part function p.ending(frame) local args = frame:getParent.args if args.mode == 'infotable' then return ' ' else return ' ' end end

return p