Module:ModifierTables/Sandbox: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 410: Line 410:
local html = mw.html.create('table')
local html = mw.html.create('table')
:addClass("wikitable sortable stickyHeader mw-collapsible")
:addClass("wikitable sortable stickyHeader mw-collapsible")
html:tag('tr'):addClass("headerRow-0")
local header = html:tag('tr'):addClass("headerRow-0")
:tag('th'):wikitext('Source')
header:tag('th'):wikitext('Source')
:tag('th'):wikitext('Type')
  :tag('th'):wikitext('Type')
:tag('th'):wikitext('[[DLC]]')
  :tag('th'):wikitext('[[DLC]]')
:tag('th'):wikitext(columnName)
  :tag('th'):wikitext(columnName)


if hasOtherModifiers and displayOtherMods then  
if hasOtherModifiers and displayOtherMods then  
html:tag('th'):wikitext('Other Modifiers')
header:tag('th'):wikitext('Other Modifiers')
end
end


Line 433: Line 433:
end)
end)
for i, row in ipairs(tableArray) do
for i, row in ipairs(tableArray) do
html:tag('tr')
local datarow = html:tag('tr')
:tag('td'):wikitext(row.icon)
datarow:tag('td'):wikitext(row.icon)
  :attr('data-sort-value', row.name)
  :attr('data-sort-value', row.name)
:tag('td'):wikitext(row.type)
datarow:tag('td'):wikitext(row.type)
  :attr('data-sort-value', row.typeText)
  :attr('data-sort-value', row.typeText)
:tag('td'):wikitext(row.expIcon)
datarow:tag('td'):wikitext(row.expIcon)
  :css('text-align', 'center')
  :css('text-align', 'center')
  :attr('data-sort-value', row.expSort)
  :attr('data-sort-value', row.expSort)
:tag('td'):wikitext(row.modifierText)
datarow:tag('td'):wikitext(row.modifierText)
  :attr('data-sort-value', row.val)
  :attr('data-sort-value', row.val)


if hasOtherModifiers and displayOtherMods then
if hasOtherModifiers and displayOtherMods then
html:tag('td'):wikitext(row.otherModifiers)
datarow:tag('td'):wikitext(row.otherModifiers)
end
end
end
end
2,875

edits