Module:HeroData: Difference between revisions

Jump to navigation Jump to search
Sur (talk | contribs)
m scalings added
Sur (talk | contribs)
m table confined to content
Line 410: Line 410:
-- First column in each row is hero name
-- First column in each row is hero name
-- This style forces the icon and the name to be on the same line, rather than
row_str = row_str .. "<td>" .. hero_icon .. "</td>"
-- adding a newline and increasing the height of all other cells in the row
hero_td_style = ' style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"'
row_str = row_str .. "<td" .. hero_td_style .. '>' .. hero_icon .. "</td>"
-- Consecutive columns are then stats
-- Consecutive columns are then stats
Line 477: Line 474:
headers_str = "<tr>" .. headers_str .. "</tr>"
headers_str = "<tr>" .. headers_str .. "</tr>"


return '<table class="wikitable sortable">' .. headers_str .. body_str .. "</table>"
local table_str = '<table class="wikitable sortable" style="table-layout: fixed; width: 100%;">' .. headers_str .. body_str .. "</table>"
local output_str = '<div style="overflow-x: auto; width: 100%;">' .. table_str .. '</div>'
return output_str
end
end


return p
return p