Aller au contenu

Module:Dates

De Wikiquestia

La documentation pour ce module peut être créée à Module:Dates/doc

local p = {}

function p.afficherComparaison(frame)
	local args = frame:getParent().args
	local res = ''
	local i = 1

	while args['Élément ' .. i] or args['Valeur ' .. i] do
		local titre = args['Élément ' .. i] or ''
		local valeur = args['Valeur ' .. i] or ''

		if titre ~= '' or valeur ~= '' then
			res = res .. string.format('<tr><td style="padding-right:1em;"><b>%s</b></td><td>%s</td></tr>', titre, valeur)
		end
		i = i + 1
	end

	if res ~= '' then
		return string.format(
			'<div class="soustitre" style="text-align:center; background-color: #ecf6fb; font-weight: bold; padding: 4px 8px; margin-top: 6px;">Comparaison</div><table class="infobox" style="width:100%%;">%s</table>',
			res
		)
	else
		return ''
	end
end

return p