Module:NavboxMobile: Difference between revisions

No edit summary
No edit summary
Line 172: Line 172:
-- Function to add a new table row with optional gutter
-- Function to add a new table row with optional gutter
local function addTableRow(tbl)
local function addTableRow(tbl)
     if tableRowAdded then
    -- Check if the spacer rows are necessary based on the listclass or bodyclass
         tbl
    local suppressSpacer = args.listclass and args.listclass:find("hlist") or
            :tag('tr')
                          args.bodyclass and args.bodyclass:find("hlist")
                :css('height', '2px')
 
                :tag('td')
    -- Only add spacer rows if they are not explicitly suppressed
                    :attr('colspan', 2)
     if tableRowAdded and not suppressSpacer then
        -- Note: You can add additional gutter styling here if needed
         tbl:tag('tr')
            :css('height', '2px')
            :tag('td')
                :attr('colspan', 2)
     end
     end
     tableRowAdded = true
     tableRowAdded = true
     return tbl:tag('tr')
     return tbl:tag('tr')
end
end


-- Function to render the navigation bar
-- Function to render the navigation bar