Module:Navbox/sandbox: Difference between revisions

Content deleted Content added
minor tweaks
change requested at Template talk:Navbox#Row colour: fix coloring of alternate rows so it always starts with 'odd' (and shows image if given) even if some list items are omitted
Line 161:
-- List rows
--
local function renderListRow(tbl, index, listnum)
local row = addTableRow(tbl)
 
if listnumindex == 1 and args.imageleft then
row
:tag('td')
Line 211:
end
 
local isOdd = (listnumindex % 2) == 1
local rowstyle = args.evenstyle
if isOdd then rowstyle = args.oddstyle end
Line 231:
:addClass(args.listclass)
:tag('div')
:css('padding', (listnumindex == 1 and args.list1padding) or args.listpadding or '0em 0.25em')
:wikitext(addNewline(args['list' .. listnum]))
 
if listnumindex == 1 and args.image then
row
:tag('td')
Line 336:
renderAboveRow(tbl)
for i, listnum in ipairs(listnums) do
renderListRow(tbl, i, listnum)
end
renderBelowRow(tbl)