Module:Aligned table: Difference between revisions
start conversion to mw.html
(rowstyle and rowclass) |
(start conversion to mw.html) |
||
Line 17: | Line 17: | ||
colstyle[1] = 'text-align:left;' | colstyle[1] = 'text-align:left;' | ||
colstyle[2] = 'text-align:right;' | colstyle[2] = 'text-align:right;' | ||
end | |||
local root = mw.html.create('table') | |||
if fullwidth ~= '' then | if fullwidth ~= '' then | ||
root | |||
:css('width', '100%') | |||
:css('border-collapse', 'collapse') | |||
:css('border-spacing', '0px') | |||
:css('border', 'none') | |||
end | end | ||
if class ~= '' then | if class ~= '' then | ||
class | root:addClass(class) | ||
end | end | ||
if style ~= '' then | if style ~= '' then | ||
style | root:cssText(style) | ||
end | end | ||
for i = 1,cols do | for i = 1,cols do | ||
colclass[ i ] = colclass[ i ] or '' | colclass[ i ] = colclass[ i ] or '' | ||
Line 73: | Line 79: | ||
end | end | ||
end | end | ||
root:wikitext(table.concat( entries, '\n' )) | |||
return tostring(root) | |||
end | end | ||
return p | return p |