Module:Aligned table: Difference between revisions
more mw.html
(start conversion to mw.html) |
(more mw.html) |
||
Line 55: | Line 55: | ||
i = math.fmod(k-1,cols) + 1 | i = math.fmod(k-1,cols) + 1 | ||
local j = (k - i) / cols + 1 | local j = (k - i) / cols + 1 | ||
local | local cell = mw.html.create('td') | ||
if args['class' .. tostring(j) .. '.' .. tostring(i)] then | if args['class' .. tostring(j) .. '.' .. tostring(i)] then | ||
cell:addClass(args['class' .. tostring(j) .. '.' .. tostring(i)]) | |||
elseif args['rowclass' .. tostring(j)] then | elseif args['rowclass' .. tostring(j)] then | ||
cell:addClass(args['rowclass' .. tostring(j)] .. '"') | |||
elseif colclass[i] ~= '' then | elseif colclass[i] ~= '' then | ||
cell:addClass(colclass[i]) | |||
end | end | ||
if args['style' .. tostring(j) .. '.' .. tostring(i)] then | if args['style' .. tostring(j) .. '.' .. tostring(i)] then | ||
cell:cssText(args['style' .. tostring(j) .. '.' .. tostring(i)]) | |||
elseif args['rowstyle' .. tostring(j)] then | elseif args['rowstyle' .. tostring(j)] then | ||
cell:cssText(args['rowstyle' .. tostring(j)]) | |||
elseif colstyle[i] ~= '' then | elseif colstyle[i] ~= '' then | ||
cell:cssText(colstyle[i]) | |||
end | end | ||
entries[ k ] = | cell:wikitext(v) | ||
entries[ k ] = tostring(cell) | |||
if i == 1 then | if i == 1 then | ||
entries[ k ] = '<tr style="vertical-align:top">' .. entries[ k ] | entries[ k ] = '<tr style="vertical-align:top">' .. entries[ k ] |