Module:Card Table

local p = {}

function p.renderCardTable(frame)

local pargs = frame:getParent.args local args = frame.args

local image = pargs['image'] or args['image'] or ''

local name = pargs['name'] or args['name'] or frame.getParent:getTitle local jpname = pargs['jpname'] or args['jpname'] or '' local jphira = pargs['jphira'] or args['jphira'] or '' local phon = pargs['phon'] or args['phon'] or ''

local color = pargs['color'] or args['color'] or ''

local cardtype = pargs['type'] or args['type'] or '' local tribe = pargs['tribe'] or args['tribe'] or '' local cost = pargs['cost'] or args['cost'] or '' local power = pargs['power'] or args['power'] or '' local icon = pargs['icon'] or args['icon'] or ''

local sets = pargs['sets'] or args['sets'] or ''

local text = pargs['text'] or args['text'] or '' local jptext = pargs['jptext'] or args['jptext'] or '' local flavor = pargs['flavor'] or args['flavor'] or ''

local illust = pargs['illust'] or args['illust'] or ''

local zxtable = mw.html.create('div') zxtable:addClass('zxtable') if color then zxtable:addClass('zx-' .. color) end

local header = zxtable:tag('div') header:addClass('zxtable-header') if pargs['color'] then header:addClass('zxheader-' .. pargs['color']) end if isnotempty(jpname) then header:wikitext("" .. name .. ' ' .. jpname .. "") else header:wikitext("" .. name .. "") end

local container = zxtable:tag('div') local image = container:tag('div') image:addClass('zxtable-image') image:wikitext('')

local wrapper = container:tag('div') wrapper:addClass('zxtable-wrapper')

local main = wrapper:tag(' ') :addClass('zxtable-main') :tag('tr') :tag('th'):wikitext(' Kana ') :tag('td'):wikitext(jphira) :tag('tr') :tag('th'):wikitext(' Rōmaji ') :tag('td'):wikitext(phon) :tag('tr') :tag('th'):wikitext(' Card Type ') :tag('td'):wikitext(type) :tag('tr') :tag('th'):wikitext(' Tribe ') :tag('td'):wikitext(tribe) :tag('tr') :tag('th'):wikitext(' Color ') :tag('td'):wikitext(color) :tag('tr') :tag('th'):wikitext(' Cost ') :tag('td'):wikitext(cost) :tag('tr') :tag('th'):wikitext(' Power ') :tag('td'):wikitext(power) :tag('tr') :tag('th'):wikitext(' Icon ') :tag('td'):wikitext(icon) :tag('th') :tag('td') :tag('table'):addClass('mw-collapsible') :tag('tr') :tag('th'):wikitext(' Sets ') :tag('tr') :tag('td'):wikitext(sets) :tag('tr') :tag('th') :tag('td') :tag('table'):addClass('mw-collapsible') :tag('tr') :tag('th'):wikitext(' Text ') :tag('tr') :tag('td'):wikitext(text) :tag('tr') :tag('th') :tag('td') :tag('table'):addClass('mw-collapsible') :tag('tr') :tag('th'):wikitext(' Japanese Text ') :tag('tr') :tag('td'):wikitext(jptext) :tag('tr') :tag('th') :tag('td') :tag('table'):addClass('mw-collapsible') :tag('tr') :tag('th'):wikitext(' Flavor ') :tag('tr') :tag('td'):wikitext(flavor) :tag('tr') :tag('th'):wikitext(' Illust. ') :tag('td'):wikitext(illust)

end

return p