Module:Shop: Difference between revisions

getToolTable: Use sticky headers
(getCookingUtilityTable: Add missing modifiers; getToolTable: Emit error when modifiers are omitted)
(getToolTable: Use sticky headers)
Line 867: Line 867:
local headerRowSpan = (Shared.tableIsEmpty(toolArray) and 1) or 2
local headerRowSpan = (Shared.tableIsEmpty(toolArray) and 1) or 2
local resultPart = {}
local resultPart = {}
table.insert(resultPart, '{| class="wikitable"')
table.insert(resultPart, '{| class="wikitable stickyHeader"')
table.insert(resultPart, '\n|- class="headerRow-0"')
table.insert(resultPart, '\n!rowspan="' .. headerRowSpan .. '" colspan="2"| Name')
table.insert(resultPart, '\n!rowspan="' .. headerRowSpan .. '" colspan="2"| Name')
table.insert(resultPart, '\n!rowspan="' .. headerRowSpan .. '"| ' .. (skillName == nil and 'Requirements' or Icons.Icon({skillName, type='skill', notext=true}) .. ' Level'))
table.insert(resultPart, '\n!rowspan="' .. headerRowSpan .. '"| ' .. (skillName == nil and 'Requirements' or Icons.Icon({skillName, type='skill', notext=true}) .. ' Level'))
Line 876: Line 877:
end
end
if headerRowSpan > 1 then
if headerRowSpan > 1 then
table.insert(resultPart, '\n|-' .. string.rep('\n!This ' .. toolName .. '\n!Total', Shared.tableCount(modifiers)))
table.insert(resultPart, '\n|- class="headerRow-1"' .. string.rep('\n!This ' .. toolName .. '\n!Total', Shared.tableCount(modifiers)))
end
end