Module:NavboxGenerator: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m use new format that allows specifying style and other attributes separately |
m center titel and display by default |
||
| Line 12: | Line 12: | ||
-- Leaf node, render Display content | -- Leaf node, render Display content | ||
table.insert(result, string.format( | table.insert(result, string.format( | ||
'<div style="font-size:%d%% | '<div style="text-align: center; font-size:%d%%; %s">%s</div>', | ||
fontSize | fontSize, data.Style or "", value | ||
)) | )) | ||
elseif type(value) == "table" then | elseif type(value) == "table" then | ||
-- Nested node, render title with optional Style and recurse | -- Nested node, render title with optional Style and recurse | ||
table.insert(result, string.format( | table.insert(result, string.format( | ||
'<div style="font-size:%d%%; border:1px solid #aaa; padding:5px; margin:2px; %s">%s</div>', | '<div style="text-align: center; font-size:%d%%; border:1px solid #aaa; padding:5px; margin:2px; %s">%s</div>', | ||
fontSize, value.Style or "", key | fontSize, value.Style or "", key | ||
)) | )) | ||