Jump to content

Module:Road data/browsetable/sandbox

From Wikipedia, the free encyclopedia
local p = {}

function p._browsetable(content, styles)
	if not content then return nil end

	local tbl = mw.html.create('table'):addClass('browse-table')
	tbl:wikitext(content)
	tbl:cssText(styles)

	return mw.getCurrentFrame():extensionTag{
		name = 'templatestyles', args = { src = 'Module:Road data/browsetable/styles.css' }
	} .. tostring(tbl)
end

function p.browsetable(frame)
	local getArgs = require('Module:Arguments').getArgs
	local args = getArgs(frame)
	return p._browsetable(args[1], args.style)
end

return p