Module:AchievementsList: Difference between revisions
From Eco - English Wiki
[checked revision] | [checked revision] |
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
local row = '' | local row = '' | ||
row = row .. "<tr>" | row = row .. "<tr>" | ||
row = row .. "<td>[[file: | row = row .. "<td>[[file:" .. v.id.. "_Icon.png|link=]]</td>" | ||
row = row .. "<td>" .. v.Name.. "<br>" .. v.Description.. " </td>" | row = row .. "<td><b>" .. v.Name.. "</b><br>" .. v.Description.. " </td>" | ||
row = row .. "</tr> \n" | row = row .. "</tr> \n" | ||
wiki = wiki .. row | wiki = wiki .. row |
Revision as of 20:04, 31 May 2024
local p = {}
function p.main()
local wiki = ''
-- import the required modules
local AchievementsData = require( "Module:AchievementsData" )
local Achievements = AchievementsData.Achievements
-- create the header of the table
local header = "<table class=\"wikitable sortable\"> \n "
header = header .. "<tr> \n "
header = header .. "<th>Icon</th> \n "
header = header .. "<th>Name and Description</th> \n "
header = header .. "</tr> \n "
wiki = header
for k,v in pairs(Achievements) do
local row = ''
row = row .. "<tr>"
row = row .. "<td>[[file:" .. v.id.. "_Icon.png|link=]]</td>"
row = row .. "<td><b>" .. v.Name.. "</b><br>" .. v.Description.. " </td>"
row = row .. "</tr> \n"
wiki = wiki .. row
end
wiki = wiki .. " </table>"
return wiki
end
return p