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')
: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('–')
: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('–')
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) + (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
end
-- registered
if args['electorate'] or args['electorate2'] or args['turnout'] or args['turnout2'] 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')
row
:tag('td')
:wikitext(fmt(electorate[1]))
if args['invalid'] and args['electorate'] then
row
:tag('td')
:wikitext(args.turnout or pct(ovalid[1] + invalid[1] + blank[1], electorate[1]))
elseif args['totalvotes'] and args['electorate'] then
row
:tag('td')
:wikitext(args.turnout or pct(totalvotes[1], electorate[1]))
elseif args['electorate'] then
row
:tag('td')
:wikitext(args.turnout or '–')
else
row
:tag('td')
:wikitext(args.turnout)
end
if has_seats and not headings['sw'] then
row
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and args['turnoutsw'] then
row
:tag('td')
:wikitext(args['turnoutsw'])
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and not args['turnoutsw'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
if rounds > 1 then
row
:tag('td')
:wikitext(fmt(electorate[2]))
if args['invalid2'] and args['electorate2'] then
row
:tag('td')
:wikitext(args.turnout2 or pct(ovalid[2] + invalid[2] + blank[2], electorate[2]))
elseif args['totalvotes2'] and args['electorate2'] then
row
:tag('td')
:wikitext(args.turnout2 or pct(totalvotes[2], electorate[2]))
elseif args['electorate2'] then
row
:tag('td')
:wikitext(args.turnout2 or '–')
else
row
:tag('td')
:wikitext(args.turnout2)
end
if has_seats and not headings['sw'] then
row
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and args['turnoutsw2'] then
row
:tag('td')
:wikitext(args['turnoutsw2'])
:tag('td')
:wikitext
end
if has_seats and headings['sw'] and not args['turnoutsw2'] then
row
:tag('td')
:attr('colspan', 2)
:wikitext
end
end
if args['turnoutsw'] and not has_sw then
row:tag('td')
:wikitext(args['turnoutsw'])
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) + (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
end
if args['majority'] then
if args['invalid'] or args['electorate'] then
row = root
:tag('tr')
:addClass('sortbottom')
row
:tag('td')
:css('background', '#eaecf0')
:attr('colspan', cols)
end
row = root
:tag('tr')
:addClass('sortbottom')
:css('text-align', '')
row
:tag('th')
:wikitext('Majority')
:attr('scope', 'row')
:attr('colspan', cs)
:css('text-align', '')
:css('font-weight', 'normal')
:css('background', 'inherit')
for k=1, rounds do
row
:tag('td')
:wikitext(fmt(majority[k]))
:tag('td')
:wikitext(fmt(majoritypct[k]))
end
if args['majoritysw'] then
row
:tag('td')
:wikitext(args['majoritysw'])
end
end
if args['result'] then
row = root:tag('tr')
:addClass('sortbottom')
-- determine the color
local color = get_color(args['resultcolour'] or nil, args['result'])
if args['resultsw'] then
row
:tag('td')
:css('background-color', color)
row
:tag('td')
:attr('colspan', 2)
:wikitext(args['result'])
row
:tag('td')
:attr('colspan', 2)
:css('text-align', '')
:wikitext('Swing')
row
:tag('td')
:css('text-align', '')
:wikitext(args['resultsw'])
else
row
:tag('td')
:css('background-color', color)
row
:tag('td')
:attr('colspan', cols - 1)
:wikitext(args['result'])
end
end
if args['majority2'] then
row = root
:tag('tr')
:addClass('sortbottom')
:css('text-align', '')
row
:tag('th')
:wikitext('Majority')
:attr('scope', 'row')
:attr('colspan', cs)
:css('text-align', '')
:css('font-weight', 'normal')
:css('background', 'inherit')
for k=1, rounds do
row
:tag('td')
:wikitext(fmt(majority2[k]))
:tag('td')
:wikitext(fmt(majoritypct2[k]))
end
if args['majoritysw2'] then
row
:tag('td')
:wikitext(args['majoritysw2'])
end
end
if args['result2'] then
row = root:tag('tr')
:addClass('sortbottom')
-- determine the color
local color = get_color(args['resultcolour'] or nil, args['result2'])
if args['resultsw2'] then
row
:tag('td')
:css('background-color', color)
row
:tag('td')
:attr('colspan', 2)
:wikitext(args['result2'])
row
:tag('td')
:attr('colspan', 2)
:css('text-align', '')
:wikitext('Swing')
row
:tag('td')
:css('text-align', '')
:wikitext(args['resultsw2'])
else
row
:tag('td')
:css('background-color', color)
row
:tag('td')
:attr('colspan', cols - 1)
:wikitext(args['result2'])
end
end
if args['source'] then
row = root:tag('tr')
:addClass('sortbottom')
:css('text-align', '')
row:tag('td')
:wikitext('மூலம்: ', args.source)
:attr('colspan', cols)
:css('text-align', '')
end
if args['embedded'] then
root:wikitext(args['embedded'])
end
return tostring(root) .. tracking
end  
return p