Module:Navbox: Difference between revisions

Ganaram inukshuk (talk | contribs)
simplify code
Tag: Reverted
Ganaram inukshuk (talk | contribs)
Undo revision 212140 by Ganaram inukshuk (talk)
Tag: Undo
Line 127: Line 127:
.. '|}\n'
.. '|}\n'
.. '</div>'
.. '</div>'
elseif navbox_type == "Subheader" or "Borderless" then
elseif navbox_type == "Nested Borderless" or navbox_type == "Borderless" then
-- Navbox has no title (by default), border, or collapse options.
-- Navbox has a title, no wikitable border, no collapse options, and no
-- This navbox is meant to display subheaders. If placed in a headerless
-- extra margin.
-- row, its title row can serve as the header.
-- This navbox is meant to be a sub-navbox, whose header row is a
-- separator, for stylistic reasons.
navbox = '{| style="mw-border-collapse: collapse; border-spacing: 0; margin: 0; width: 100%;"'
.. p.nested_navbox_title(title, false)
-- Add header
if header_row ~= nil then
navbox = navbox .. p.navbox_header_footer(header_row)
end
-- Add rows
for i = 1, #rows do
navbox = navbox .. p.navbox_row(rows[i], is_data_navbox[i])
end
-- Add footer
if footer_row ~= nil then
navbox = navbox .. p.navbox_header_footer(footer_row)
end
-- End of table
navbox = navbox
.. '|}\n'
.. '</div>'
elseif navbox_type == "Subheader" then
-- Navbox has no title, border, or collapse options.
-- This navbox is meant to display subheaders.
navbox = '{| style="mw-border-collapse: collapse; border-spacing: 0; margin: 0; width: 100%;\n'
navbox = '{| style="mw-border-collapse: collapse; border-spacing: 0; margin: 0; width: 100%;\n'
.. p.nested_navbox_title(title, false)
-- Add rows
-- Add rows