Module:ItemTables: Difference between revisions

Jump to navigation Jump to search
add comment, add filter function WIP
m rename vars, spacing
Line 123: Line 123:
local filteredTable = {}
local filteredTable = {}
filteredTable = get_similar_items(listofKeysTable)
filteredTable = get_similar_items(listofKeysTable)
local createTable = mw.html.create('table')
local createTable = mw.html.create('table')
Line 129: Line 128:
:tag('caption'):wikitext("List of Items"):done()
:tag('caption'):wikitext("List of Items"):done()
local createTableRow = mw.html.create('tr')
local createTableHeader = mw.html.create('tr')
createTableRow
createTableHeader
:tag('th'):wikitext('Name'):done()
:tag('th'):wikitext('Name'):done()
:tag('th'):wikitext('Cost'):done()
:tag('th'):wikitext('Cost'):done()
Line 136: Line 135:
:tag('th'):wikitext('Stat change'):done()
:tag('th'):wikitext('Stat change'):done()
createTable:node(createTableRow)
createTable:node(createTableHeader)
-- query all items
-- query all items
Line 168: Line 167:
for _, row in ipairs(requirements) do
for _, row in ipairs(requirements) do
createTableRow:node(row)
createTableHeader:node(row)
end
end
--createTable:node(createTableRow)
--createTable:node(createTableHeader)
return tostring(createTable)
return tostring(createTable)
--return listofItems -- this is just a string list, same thing as createTable. delete this when line when finished
--return listofItems -- this is just a string list, same thing as createTable. delete this when line when finished