Module:TableGenerator: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Tag: Undo |
m only color slightly darker if class is Statbox_hero |
||
| Line 13: | Line 13: | ||
local cols = tonumber(args['cols']) or 3 -- Default number of columns is 3 | local cols = tonumber(args['cols']) or 3 -- Default number of columns is 3 | ||
local onlyBody = args['onlyBody'] == 'true' -- Check if onlyBody is set to true | local onlyBody = args['onlyBody'] == 'true' -- Check if onlyBody is set to true | ||
local class_is_statbox = args['class'] == 'Statbox_hero' | |||
local cell_values = args['cell_values'] or "" -- Get the cell values argument | local cell_values = args['cell_values'] or "" -- Get the cell values argument | ||
local values = {} -- Table to hold the individual cell values | local values = {} -- Table to hold the individual cell values | ||
| Line 40: | Line 41: | ||
-- If the value contains a " 0 " then it will be colored slightly darker | -- If the value contains a " 0 " then it will be colored slightly darker | ||
local class = '' | local class = '' | ||
if value:find(" 0[^%.]") then | if (class_is_statbox) then | ||
if value:find(" 0[^%.]") then | |||
class = ' class="darker"' | |||
end | |||
end | |||
-- Add the value as a table cell with the appropriate class | -- Add the value as a table cell with the appropriate class | ||