385
edits
(add more newlines) |
m (13 revisions imported from wikipedia:Module:Side_box: see Topic:Vtixlm0q28eo6jtf) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 71: | Line 71: | ||
-- Table root | -- Table root | ||
local root = mw.html.create('table') | local root = mw.html.create('table') | ||
root:attr('role', 'presentation') | |||
for i, class in ipairs(data.classes or {}) do | for i, class in ipairs(data.classes or {}) do | ||
root:addClass(class) | root:addClass(class) | ||
end | end | ||
root:css{border = '1px solid #aaa', ['background-color'] = '#f9f9f9'} | root:css{border = '1px solid #aaa', ['background-color'] = '#f9f9f9', color = '#000'} | ||
if data.style then | if data.style then | ||
root:cssText(data.style) | root:cssText(data.style) | ||
Line 81: | Line 82: | ||
-- The "above" row | -- The "above" row | ||
if data.above then | if data.above then | ||
local aboveCell = root:newline()tag('tr'):tag('td') | local aboveCell = root:newline():tag('tr'):tag('td') | ||
aboveCell | aboveCell | ||
:attr('colspan', data.imageright and 3 or 2) | :attr('colspan', data.imageright and 3 or 2) | ||
Line 116: | Line 117: | ||
:wikitext(data.imageright) | :wikitext(data.imageright) | ||
end | end | ||
-- The below row | -- The below row | ||
Line 127: | Line 127: | ||
belowCell:cssText(data.textstyle) | belowCell:cssText(data.textstyle) | ||
end | end | ||
belowCell | belowCell:wikitext(data.below) | ||
end | end | ||
root:newline() | |||
return tostring(root) | return tostring(root) | ||
end | end | ||
return p | return p |