row
:css('background-color', args['acolor' .. v])
:tag('td')
:css('background-color', color)
:css('width', '')
-- add the rest of the row
if args['dsv'] then
row
:tag('td')
:wikitext(args['party' .. v])
row
:tag('td')
:wikitext(args['cand' .. v])
end
if headings['cand'] and not args['dsv'] and not headings['alliance'] then
row
:tag('td')
:wikitext(args['cand' .. v])
if headings['vp'] then
row
:tag('td')
:wikitext(args['vp' .. v])
end
end
if headings['party'] and not args['dsv'] then
row
:tag('td')
:wikitext(args['party' .. v])
end
end
if args['votes' .. v] then
row:tag('td')
:attr('rowspan', args['vspan' .. v])
:css('text-align', '')
:wikitext(fmt(args['votes' .. v]))
row:tag('td')
:attr('rowspan', args['vspan' .. v])
:css('text-align', '')
:wikitext(pct(args['votes' .. v], valid[1]))
elseif args['ivotes' .. v] or args ['ipct' .. v] or args['atotal' .. v] then
row:tag('td')
:attr('rowspan', args['vspan' .. v])
:css('text-align', '')
:css('font-style', 'italic')
:wikitext(fmt(args['ivotes' .. v]) or fmt(args['atotal' .. v]))
if args['ipct' .. v] or args['apct' .. v] or args['atotal' .. v] then
row:tag('td')
:attr('rowspan', args['vspan' .. v])
:css('text-align', '')
:css('font-style', 'italic')
:wikitext(args['ipct' .. v] or args['apct' .. v] or pct(args['atotal' .. v], valid[1]))
else
row:tag('td')
:attr('rowspan', args['vspan' .. v])
:wikitext
end
elseif has_votes and not headings['sw'] and not has_seats and not has_rspan or args['invalid'] and not headings['sw'] and not has_seats and not has_rspan or args['totalvotes'] and not headings['sw'] and not has_seats and not has_rspan or args['electorate'] and not headings['sw'] and not has_seats and not has_rspan or args['turnout'] and not headings['sw'] and not has_seats and not has_rspan or has_seats and args['seats' .. v] and not args['votes' .. v] and not args['ivotes' .. v] and not has_rspan or has_votes and not args['votes' .. v] and not args['ivotes' .. v] and not args['ipct' .. v] and not args['apct' .. v] and not args['atotal' .. v] and args['row' .. v] and args['seats' .. v] and headings ['alliance'] and not headings['sw'] or args['atotalnv' .. v] and args['aseats' .. v] and not has_rspan then
row:tag('td')
:attr('colspan', 2)
elseif has_seats and not args['seats' .. v] and not headings['sw'] and not has_rspan or has_votes and headings['sw'] and not has_seats and not has_rspan then
row:tag('td')
:attr('colspan', 3)
elseif has_seats and headings['sw'] and not has_rspan then
row:tag('td')
:attr('colspan', 4)
end
if headings['sw'] and args['votes' .. v] or headings['sw'] and args['ivotes' .. v] or headings['sw'] and args['atotal' .. v] then
row
:tag('td')
:css('text-align', '')
:wikitext(args['sw' .. v])
end
if headings['seats'] and not args['dsv'] and not has_seats and rounds < 2 or has_seats and args['seats' .. v] or has_seats and args['votes' .. v] or has_seats and args['iseats' .. v] or has_seats and args['aseats' .. v] then
if args['iseats' .. v] or args['aseats' .. v] then
row
:tag('td')
:css('font-style', 'italic')
:css('text-align', '')
:wikitext(args['iseats' .. v] or args['aseats' .. v])
elseif args['seats' .. v] or headings['seats'] and not has_sspan then
row
:tag('td')
:attr('rowspan', args['sspan' .. v])
:css('text-align', '')
:wikitext(fmt(args['seats' .. v]) or '–')
end
end
if args['votes' .. v .. '_2'] then
row:tag('td')
:attr('rowspan', args['v2span' .. v])
:css('text-align', '')
:wikitext(fmt(args['votes' .. v .. '_2']))
row:tag('td')
:attr('rowspan', args['v2span' .. v])
:css('text-align', '')
:wikitext(pct(args['votes' .. v .. '_2'], valid[2]))
elseif args['ivotes' .. v .. '_2'] or args ['ipct' .. v.. '_2'] or args['avotes' .. v .. '_2'] then
row:tag('td')
:attr('rowspan', args['v2span' .. v])
:css('text-align', '')
:css('font-style', 'italic')
:wikitext(fmt(args['ivotes' .. v .. '_2']) or fmt(args['avotes' .. v .. '_2']))
row:tag('td')
:attr('rowspan', args['v2span' .. v])
:css('text-align', '')
:css('font-style', 'italic')
:wikitext(args['ipct' .. v .. '_2'] or args['apct' .. v .. '_2'] or pct(args['avotes' .. v .. '_2'], valid[2]))
elseif args['invalid2'] and args['seats' .. v .. '_2'] and not has_rspan or args['totalvotes2'] and args['seats' .. v .. '_2'] and not has_rspan or args['electorate2'] and args['seats' .. v .. '_2'] and not has_rspan or args['turnout2'] and args['seats' .. v .. '_2'] and not has_rspan or has_votes and rounds > 1 and args['seats' .. v .. '_2'] and not has_rspan or has_votes and rounds > 1 and not has_seats and not has_rspan or has_seats and not args['votes' .. v .. '_2'] and args['seats' .. v .. '_2'] and not has_rspan or args['atotalnv' .. v] and args['aseats' .. v .. '_2'] and not has_rspan or args['v2block' .. v] then
row:tag('td')
:attr('colspan', 2)
:attr('rowspan', args['v2block' .. v])
elseif has_seats and not args['seats' .. v .. '_2'] and not headings['sw'] and not has_rspan then
row:tag('td')
:attr('colspan', 3)
elseif has_seats and headings['sw'] and not has_rspan then
row:tag('td')
:attr('colspan', 4)
end
if headings['seats'] and args['dsv'] and not has_sspan or headings['seats'] and rounds > 1 and not has_seats and not has_sspan or args['seats' .. v] and has_sspan and rounds > 1 then
row
:tag('td')
:attr('rowspan', args['sspan' .. v])
:css('text-align', '')
:wikitext(fmt(args['seats' .. v]) or '–')
end
if has_sw and args['votes' .. v .. '_2'] then
row
:tag('td')
:css('text-align', '')
:wikitext(args['sw' .. v .. '_2'])
end
if args['seats' .. v .. '_2'] or has_seats and args['votes' .. v .. '_2'] then
row
:tag('td')
:css('text-align', '')
:wikitext(fmt(args['seats' .. v .. '_2']) or '–')
end
if args['iseats' .. v .. '_2'] or has_seats and args['ivotes' .. v .. '_2'] and not args['seats' .. v .. '_2'] or args['aseats' .. v .. '_2'] then
row
:tag('td')
:css('text-align', '')
:wikitext(fmt(args['iseats' .. v .. '_2']) or fmt(args['aseats' .. v .. '_2']))
end
if headings['st1t'] then
row
:tag('td')
:css('text-align', '')
:wikitext(args['st1t' .. v] or '–')
end
if headings['st2t'] then
row
:tag('td')
:css('text-align', '')
:wikitext(args['st2t' .. v] or '–')
end
if headings['st3t'] then
row
:tag('td')
:css('text-align', '')
:wikitext(args['st3t' .. v] or '–')
end
if headings['st4t'] then
row
:tag('td')
:css('text-align', '')
:wikitext(args['st4t' .. v] or '–')
end
if headings['st5t'] then
row
:tag('td')
:css('text-align', '')
:wikitext(args['st5t' .. v] or '–')
end
if headings['totseats'] and not args['itotseats' .. v] and not args['atotseats' .. v] then
row
:tag('td')
:css('text-align', '')
:wikitext(fmt(args['totseats' .. v]) or '–')
elseif headings['totseats'] then
row
:tag('td')
:css('text-align', '')
:css('font-style', 'italic')
:wikitext(args['itotseats' .. v] or args['atotseats' .. v])
end
if headings['sc'] and args.sctitle then
row
:tag('td')
:wikitext(args['sc' .. v])
elseif headings['sc'] then
row
:tag('td')
:css('text-align', '')
:wikitext(args['sc' .. v] or '–')
end
end
end
-- separating line
if args['valid'] or args['valid2'] or args['invalid'] or args['invalid2'] or args['totalvotes'] or args['totalvotes2'] or args['electorate'] or args['electorate2'] or args['turnout'] or args['turnout2'] or args['source'] then
row = root
:tag('tr')
:addClass('sortbottom')
row
:tag('td')
:css('background', '#eaecf0')
:attr('colspan', cols)
end
-- valid votes
if args['invalid'] or args['invalid2'] then
row = root
:tag('tr')
:addClass('sortbottom')
:css('text-align', '')
row
:tag('th')
:wikitext('செல்லுபடியான வாக்குகள்')
:attr('scope', 'row')
:attr('colspan', cs)
:css('text-align', '')
:css('font-weight', 'normal')
:css('background', 'inherit')
if args['invalid'] then
row
:tag('td')
:wikitext(fmt(ovalid[1]))
:tag('td')
:wikitext(pct(ovalid[1], ovalid[1] + invalid[1] + blank[1]))
elseif not args['invalid'] then
row
:tag('td')
:wikitext
:tag('td')
:wikitext
end
if has_seats and not headings['sw'] then
row
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and args['validsw'] then
row
:tag('td')
:wikitext(args['validsw'])
:tag('td')