2,875
edits
No edit summary |
No edit summary |
||
Line 163: | Line 163: | ||
function p.getFishingJunkTable(frame) | function p.getFishingJunkTable(frame) | ||
local | local html = mw.html.create('table') | ||
html:addClass('wikitable sortable stickyHeader') | |||
-- Add header row | |||
local headerRow = html:tag('tr'):addClass('headerRow-0') | |||
headerRow:tag('th'):attr('colspan', '2'):wikitext('Item') | |||
headerRow:tag('th'):wikitext('Value') | |||
local itemArray = {} | local itemArray = {} | ||
Line 177: | Line 180: | ||
table.sort(itemArray, function(a, b) return a.name < b.name end) | table.sort(itemArray, function(a, b) return a.name < b.name end) | ||
-- Add item rows | |||
for i, item in ipairs(itemArray) do | for i, item in ipairs(itemArray) do | ||
local row = html:tag('tr') | |||
row:tag('td'):addClass('table-img') | |||
:wikitext(Icons.Icon({item.name, type='item', notext=true})) | |||
row:tag('td'):wikitext(Icons.Icon({item.name, type='item', noicon=true})) | |||
row:tag('td') | |||
:attr('data-sort-value', item.sellsFor) | |||
:wikitext(Items.getValueText(item)) | |||
end | end | ||
return | return tostring(html) | ||
end | end | ||
edits