Module:TableGenerator: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m only color slightly darker if class is Statbox_hero |
m use class if not 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 | local class = args['class'] | ||
local class_is_statbox = 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 | local class_str = '' | ||
if (class_is_statbox) then | if (class_is_statbox) then | ||
if value:find(" 0[^%.]") then | if value:find(" 0[^%.]") then | ||
class_str = ' class="darker"' | |||
end | end | ||
else | |||
class_str = ' class="' .. class .. '"' | |||
end | end | ||