Module:Historical populations and Module:Historical populations/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
imported>Rjjiii
for dark mode
 
imported>Rjjiii (ii)
older version for comparison; will explain on talk page later
 
Line 93: Line 93:
-- population cell
-- population cell
if(popname == '') then
if(popname == '') then
popname = '<abbr title="Population" class="abbr-header">Pop.</abbr>'
popname = '<abbr title="Population">Pop.</abbr>'
end
end


Line 99: Line 99:
if( percentages ~= 'off' and percentname == '') then
if( percentages ~= 'off' and percentname == '') then
if( percentages == 'pagr' ) then
if( percentages == 'pagr' ) then
percentname = '<abbr title="Per annum growth rate" class="abbr-header">±% p.a.</abbr>'
percentname = '<abbr title="Per annum growth rate">±% p.a.</abbr>'
elseif( percentages == 'monthly' ) then
elseif( percentages == 'monthly' ) then
percentname = '<abbr title="Per month growth rate" class="abbr-header">±% p.m.</abbr>'
percentname = '<abbr title="Per month growth rate">±% p.m.</abbr>'
else
else
percentname = '<abbr title="Percent change" class="abbr-header">±%</abbr>'
percentname = '<abbr title="Percent change">±%</abbr>'
end
end
end
end
Line 177: Line 177:
cell = trow:tag('th')
cell = trow:tag('th')
cell
cell
:css('border-bottom', '1px solid var(--color-base, #000000)')
:css('border-bottom', '1px solid black')
:css('padding', pad and ('1px ' .. pad) or '1px')
:css('padding', pad and ('1px ' .. pad) or '1px')
:css('text-align', align)
:css('text-align', align)
Line 229: Line 229:
local caption = root:tag('caption')
local caption = root:tag('caption')
caption
caption
:css('border-top', '1px #aaa solid')
:css('border-left', '1px #aaa solid')
:css('border-right', '1px #aaa solid')
:css('background-color', 'lavender')
:css('padding', '0.25em')
:css('padding', '0.25em')
:css('font-weight', 'bold')
:css('font-weight', 'bold')
:attr('class', 'caption-purple')
:wikitext(title)
:wikitext(title)
Line 240: Line 243:
cell
cell
:attr('colspan', colspan)
:attr('colspan', colspan)
:css('border-bottom', '1px solid var(--color-base, #000000)')
:css('border-bottom', '1px solid black')
:wikitext(graph)
:wikitext(graph)
graph = ''
graph = ''
Line 255: Line 258:
row:attr('valign', 'top')
row:attr('valign', 'top')
cell = row:tag('td')
cell = row:tag('td')
cell
cell:css('padding', '0 0.5em')
:css('padding', '0 0.5em')
else
else
cell = row:tag('td')
cell = row:tag('td')
Line 311: Line 313:
cell
cell
:attr('colspan', colspan)
:attr('colspan', colspan)
:css('border-top', '1px solid var(--color-base, #000000)')
:css('border-top', '1px solid black')
:wikitext(graph)
:wikitext(graph)
graph = ''
graph = ''
Line 321: Line 323:
cell
cell
:attr('colspan', colspan)
:attr('colspan', colspan)
:css('border-top', '1px solid var(--color-base, #000000)')
:css('border-top', '1px solid black')
:css('font-size', '85%')
:css('font-size', '85%')
:css('text-align', alignfn)
:css('text-align', alignfn)
Line 365: Line 367:
cell
cell
:attr('colspan', colsperrow + 1)
:attr('colspan', colsperrow + 1)
:css('border-bottom', '1px solid var(--color-base, #000000)')
:css('border-bottom', '1px solid black')
:wikitext(graph)
:wikitext(graph)
graph = ''
graph = ''
Line 436: Line 438:
cell
cell
:attr('colspan', colsperrow + 1)
:attr('colspan', colsperrow + 1)
:css('border-top', '1px solid var(--color-base, #000000)')
:css('border-top', '1px solid black')
:wikitext(graph)
:wikitext(graph)
graph = ''
graph = ''
Line 446: Line 448:
cell = row:tag('td')
cell = row:tag('td')
cell
cell
:css('border-top', '2px solid var(--color-base, #000000)')
:css('border-top', '2px solid black')
:css('font-size', '85%')
:css('font-size', '85%')
:css('text-align', alignfn)
:css('text-align', alignfn)
Line 491: Line 493:


-- setup classes and styling for outer table
-- setup classes and styling for outer table
local class = direction == 'horizontal' and 'wikitable' or 'table-pale'
local class = direction == 'horizontal' and 'wikitable' or 'toccolours'
if( state == 'collapsed' ) then
if( state == 'collapsed' ) then
class = class .. ' collapsible collapsed'
class = class .. ' collapsible collapsed'