Difference between revisions of "Module:Navbox"

From Taskman Wiki
Jump to navigation Jump to search
(very prototype navbox module)
 
m
Line 10: Line 10:
 
       table = table .. "<tr>"
 
       table = table .. "<tr>"
 
       if args["title"..j] then
 
       if args["title"..j] then
         table = table .. '<td class="navbox-group-title">' .. args["title"..j] .. '</td>'
+
         table = table .. '<td class="navbox-group-title"><p>' .. args["title"..j] .. '</p></td>'
 
       end
 
       end
       table = table .. '<td class="navbox-group">' .. args["group"..j] .. '</td></tr>'
+
       table = table .. '<td class="navbox-group"><p>' .. args["group"..j] .. '</p></td></tr>'
 
     end
 
     end
 
   end
 
   end

Revision as of 11:26, 19 May 2020

Documentation for this module may be created at Module:Navbox/doc

local p = {};

function p.navbox(frame)
  local args = frame:getParent().args
  local table = '<table class="navbox mw-collapsible"><tr>'
  table = table .. '<th colspan="2" class="navbox-header">' .. args.title .. '</th></tr>'
  for i = 1,20 do
    local j = tostring(i)
    if args["group"..j] then
      table = table .. "<tr>"
      if args["title"..j] then
        table = table .. '<td class="navbox-group-title"><p>' .. args["title"..j] .. '</p></td>'
      end
      table = table .. '<td class="navbox-group"><p>' .. args["group"..j] .. '</p></td></tr>'
    end
  end
  table = table .. "</table>"
  return table
end

return p