Moduł:Navbox/printer/columns
Wygląd
Dokumentacja modułu
[stwórz] [ ]
Zobacz podstrony tego modułu.
require ("strict")
local res = mw.loadData('Moduł:Navbox/res')
return {
root = 'table',
update = function(container, isleaf, node, printlog)
if printlog then
printlog.allCols = (printlog.allCols or 0) + 1
if isleaf then
printlog.cols = (printlog.cols or 0) + 1
end
end
end,
print = function(container,tree,printList, printlog)
container:addClass(res.class.innerColumns)
local hasTH = tree[1].peek(res.arg.group.name)
if hasTH then
local trh = container:tag('tr')
for i, node in ipairs(tree) do
trh:tag('th')
:addClass(res.class.group)
:addClass(node.address())
:attr('scope', 'col')
:wikitext(node.get(res.arg.group.name))
end
end
local trd = container:tag('tr')
for i, node in ipairs(tree) do
local td = trd:tag('td')
:addClass(res.class.list)
:addClass(node.address())
printList(td, node)
end
end,
}