: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')
:wikitext
end
if has_seats and headings['sw'] and not args['validsw'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
if rounds > 1 and args['invalid2'] then
row
:tag('td')
:wikitext(fmt(ovalid[2]))
:tag('td')
:wikitext(pct(ovalid[2], ovalid[2] + invalid[2] + blank[2]))
elseif rounds > 1 and not args['invalid2'] 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['validsw2'] then
row
:tag('td')
:wikitext(args['validsw2'])
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and not args['validsw2'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
if args['invalidsw'] and not has_sw then
row:tag('td')
:wikitext(args['validsw'])
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0) + (headings['st1t'] and 1 or 0) + (headings['st2t'] and 1 or 0) + (headings['st3t'] and 1 or 0) + (headings['st4t'] and 1 or 0) + (headings['st5t'] and 1 or 0)
if headings['seats'] or headings['sc'] then
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0) + (headings['st1t'] and 1 or 0) + (headings['st2t'] and 1 or 0) + (headings['st3t'] and 1 or 0) + (headings['st4t'] and 1 or 0) + (headings['st5t'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
elseif headings['sw'] or headings['seats'] or headings['sc'] or headings['st1t'] or headings['st2t'] or headings['st3t'] or headings['st4t'] or headings['st5t'] then
local cspan = (headings['sw'] and 1 or 0) + (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0) + (headings['st1t'] and 1 or 0) + (headings['st2t'] and 1 or 0) + (headings['st3t'] and 1 or 0) + (headings['st4t'] and 1 or 0) + (headings['st5t'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
-- invalid votes
row = root:tag('tr')
:addClass('sortbottom')
:css('text-align', '')
if args['invalidonly'] or args['blank'] then
row
:tag('th')
:wikitext('செல்லாத வாக்குகள்')
:attr('scope', 'row')
:attr('colspan', cs)
:css('text-align', '')
:css('font-weight', 'normal')
:css('background', 'inherit')
else
row
:tag('th')
:wikitext('செல்லாத/வெற்று வாக்குகள்')
:wikitext(args.invalidnote)
:attr('scope', 'row')
:attr('colspan', cs)
:css('text-align', '')
:css('font-weight', 'normal')
:css('background', 'inherit')
end
if args['invalid'] then
row
:tag('td')
:wikitext(fmt(invalid[1]))
:tag('td')
:wikitext(pct(invalid[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['invalidsw'] then
row
:tag('td')
:wikitext(args['invalidsw'])
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and not args['invalidsw'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
if rounds > 1 and args['invalid2'] then
row
:tag('td')
:wikitext(fmt(invalid[2]))
:tag('td')
:wikitext(pct(invalid[2], ovalid[2] + invalid[2] + blank[2]))
elseif rounds > 1 and not args['invalid2'] 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['invalidsw2'] then
row
:tag('td')
:wikitext(args['invalidsw2'])
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and not args['invalidsw2'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
if args['invalidsw'] and not has_sw then
row:tag('td')
:wikitext(args['invalidsw'])
if headings['seats'] or headings['sc'] or headings['st1t'] or headings['st2t'] or headings['st3t'] or headings['st4t'] or headings['st5t'] then
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
elseif headings['sw'] or headings['seats'] or headings['sc'] or headings['st1t'] or headings['st2t'] or headings['st3t'] or headings['st4t'] or headings['st5t'] then
local cspan = (headings['sw'] and 1 or 0) + (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0) + (headings['st1t'] and 1 or 0) + (headings['st2t'] and 1 or 0) + (headings['st3t'] and 1 or 0) + (headings['st4t'] and 1 or 0) + (headings['st5t'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
end
-- blank votes
if args['blank'] then
row = root:tag('tr')
:addClass('sortbottom')
:css('text-align', '')
row
:tag('th')
:wikitext('Blank votes')
:attr('scope', 'row')
:attr('colspan', cs)
:css('text-align', '')
:css('font-weight', 'normal')
:css('background', 'inherit')
row
:tag('td')
:wikitext(fmt(blank[1]))
:tag('td')
:wikitext(pct(blank[1], ovalid[1] + invalid[1] + blank[1]))
if has_seats and not headings['sw'] then
row
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and args['blanksw'] then
row
:tag('td')
:wikitext(args['blanksw'])
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and not args['blanksw'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
if rounds > 1 and args['blank2'] then
row
:tag('td')
:wikitext(fmt(blank[2]))
:tag('td')
:wikitext(pct(blank[2], ovalid[2] + invalid[2] + blank[2]))
elseif rounds > 1 and not args['blank2'] 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['blanksw2'] then
row
:tag('td')
:wikitext(args['blanksw2'])
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and not args['blanksw2'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
if args['blanksw'] and not has_sw then
row:tag('td')
:wikitext(args['blanksw'])
if headings['seats'] or headings['sc'] or headings['st1t'] or headings['st2t'] or headings['st3t'] or headings['st4t'] or headings['st5t'] then
local cspan = (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
elseif headings['sw'] or headings['seats'] or headings['sc'] or headings['st1t'] or headings['st2t'] or headings['st3t'] or headings['st4t'] or headings['st5t'] then
local cspan = (headings['sw'] and 1 or 0) + (headings['seats'] and 1 or 0) + (headings['sc'] and 1 or 0) + (headings['st1t'] and 1 or 0) + (headings['st2t'] and 1 or 0) + (headings['st3t'] and 1 or 0) + (headings['st4t'] and 1 or 0) + (headings['st5t'] and 1 or 0)
row
:tag('td')
:attr('colspan', cspan > 1 and cspan or nil)
end
end
-- total
if args['invalid'] or args['totalvotes'] or args['invalid2'] or args['totalvotes2'] then
row = root:tag('tr')
:addClass('sortbottom')
:css('font-weight', 'bold')
:css('text-align', '')
row
:tag('th')
:wikitext('மொத்த வாக்குகள்')
:attr('scope', 'row')
:attr('colspan', cs)
:css('text-align', '')
:css('background', 'inherit')
if not args['totalvotes'] and args['invalid'] then
row
:tag('td')
:wikitext(fmt(ovalid[1] + invalid[1] + blank[1]))
:tag('td')
:wikitext(pct(1, 1))
elseif args['totalvotes'] then
row
:tag('td')
:wikitext(fmt(args.totalvotes))
:tag('td')
:wikitext('–')
elseif not args['invalid'] and not args['totalvotes'] 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['invalidsw'] then
row
:tag('td')
:wikitext('–')
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and not args['invalidsw'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
if rounds > 1 and args['invalid2'] and not args['totalvotes2'] then
row
:tag('td')
:wikitext(fmt(ovalid[2] + invalid[2] + blank[2]))
:tag('td')
:wikitext(pct(1, 1))
elseif rounds > 1 and args['totalvotes2'] then
row
:tag('td')
:wikitext(fmt(args.totalvotes2))
:tag('td')
:wikitext('–')
elseif rounds > 1 and not args['invalid2'] or rounds > 1 and not args['totalvotes2'] then
row
:tag('td')