Module:Event list: Difference between revisions

Content deleted Content added
creating a lua version of template:event list which was originally created by User:Pee Tern
 
No edit summary
Line 8:
local title = args['title'] or 'Chronology of events for ' .. mw.title.getCurrentTitle().text
local columnscols = tonumber(args['columns'] or '2') or 2
local datewidth = args['datewidth'] or '-1'
local collapse = args['collapse'] or 'collapsed'
Line 55:
:css('width', '100%')
-- Add the title
root:tag('tr'):tag('th'):attr('colspan', columnscols):wikitext(title)
-- Create the row to hold the columns
local outerrow = root:tag('tr')
local percol = math.ceil((#eventnums) / columnscols)
k = 0
for i = 1,columnscols do
local outercell = outerrow:tag('td'):css('width', (math.floor(10/cols)/10) .. '%')
local innertable = outercell:tag('table'):css('width', '100%')