Module:Progression rainbow/sandbox: Difference between revisions

Content deleted Content added
all done
swap to divs
Line 106:
end
local root = mw.html.create('tablediv')
root:addClass('progression-rainbow')
:attr('role', 'presentation')
:tag('tr')
:addClass('progression-rainbow-mystery')
-- We add a tr here. MediaWiki (Remex we think) adds a second. One of
-- them becomes <tr class='mw-empty-elt'></tr>. Removing this one
-- results in only
 
for _, class in ipairs(classes) do
if class.count ~= 0 then
local percentage = class_percent(class.count, total)
-- tr problem is unrelated to this newline()
root:newline() -- sprinkled through to make the HTML easier to read
root:tag('tddiv')
:css('background', frame:expandTemplate{
title = 'class/colour', args = { class.class }
Line 136 ⟶ 129:
local remaining = percent_remaining(sum_classes, total)
if remaining then
root:tag('tddiv')
:addClass('remaining')
:css('width', remaining)