Module:Election results/sandbox: Difference between revisions

Content deleted Content added
rv one back- is putting rowscopes on parties even when candidates listed
+
 
(13 intermediate revisions by 2 users not shown)
Line 263:
-- build the table
local root = mw.html.create(args['embed'] and '' or 'table')
if args['embed'] == nil and args['floatright'] then
root
:addClass('wikitable sortable floatright')
:tag('caption')
:wikitext(args.caption)
:done()
elseif args['embed'] == nil then
root
:addClass('wikitable sortable')
Line 340 ⟶ 346:
:attr('rowspan', rowspan)
:attr('colspan', 2)
if headings['vp'] then
row
:tag('th')
:wikitext('Running mate')
:attr('scope', 'col')
:attr('rowspan', rowspan)
:done()
cols = cols + 1
end
row
:tag('th')
Line 367 ⟶ 382:
cols = cols + 1
end
if headings['vp'] and not has_alliance then
row
:tag('th')
Line 697 ⟶ 712:
row
:tag('td')
:attr('rowspan', args['candspan' .. v] or args['aspan' .. v])
:wikitext(args['vp' .. v])
end
Line 721 ⟶ 737:
:wikitext(args['alliance' .. v])
end
if args['alliance' .. v] and args['party' .. v] and not has_cand then
row
:tag('td')
:attr('rowspan', args['aspan' .. v])
:attr('scope', 'row')
:wikitext(args['alliance' .. v])
elseif args['alliance' .. v] and args['party' .. v] and args.dsv then
row
:tag('td')
:attr('rowspan', args['aspan' .. v])
:attr('scope', 'row')
:wikitext(args['alliance' .. v])
elseif args['alliance' .. v] and args['party' .. v] then
row
:tag('td')
:attr('rowspan', args['aspan' .. v])
:wikitext(args['alliance' .. v])
end
if args['party' .. v] and not has_alliance orand args['cand' .. v] and has_party and not has_alliancedsv then
row
:tag('td')
:attr('scope', 'row')
:wikitext(args['party' .. v])
elseif args['party' .. v] and not has_cand and not has_alliance then
row
:tag('td')
:attr('scope', 'row')
:wikitext(args['party' .. v])
elseif args['party' .. v] and not has_alliance or args['cand' .. v] and has_party and not has_alliance then
row
:tag('td')