561
edits
Auburnsummer (talk | contribs) No edit summary |
Auburnsummer (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
p.main = function( frame ) | p.main = function( frame ) | ||
return | local ratio = tonumber(frame.args['ratio']) | ||
local sheetWidth = tonumber(frame.args['sheetWidth']) | |||
local sheetHeight = tonumber(frame.args['sheetHeight']) | |||
local noOfRows = tonumber(frame.args['noOfRows']) | |||
local noOfColumns = tonumber(frame.args['noOfColumns']) | |||
local cellWidth = sheetWidth / noOfRows | |||
local cellHeight = sheetHeight / noOfColumns | |||
local outerSpan = mw.html.create('span') | |||
outerSpan | |||
:css({ | |||
position = 'relative', | |||
height = tostring(cellHeight * ratio) .. 'px', | |||
width = tostring(cellWidth * ratio) .. 'px', | |||
overflow = 'hidden', | |||
display = 'inline-block', | |||
['vertical-align'] = 'middle' | |||
}) | |||
return tostring(outerSpan) | |||
end | end | ||
return p | return p |