Module:HeroTableBuilder/example

local HeroTableBuilder = require 'Module:HeroTableBuilder'

local main = function local units = mw.ext.cargo.query('Units', "_pageName,IFNULL(CONCAT(Name,': ',Title),Name)=name,MoveType,WeaponType,Origin,Description,Entries", {		where = "_pageName LIKE 'D%'",		orderBy = 'name',		limit = 1000,	})

local theUnit = nil local builder = HeroTableBuilder.new

builder:column('Origin', function (elem) elem:wikitext(theUnit.Origin) end) builder:heroIcon builder:heroLink builder:heroEntry builder:moveType builder:weaponType builder:column('Description', function (elem) elem:wikitext(theUnit.Description) end):css('width', '50%')

for _, u in ipairs(units) do		theUnit = u		builder:addHero(u._pageName, u.name, u.MoveType, u.WeaponType, u.Entries) end

return builder:build:addClass('wikitable'):addClass('default'):css('text-align', 'center'):css('width', '100%') end

return {main = main}