Jump to content

Module:Road data/browsetable: Difference between revisions

From Wikipedia, the free encyclopedia
Remove the "s" from styles
m Protected "Module:Road data/browsetable": High-risk template or module: 10686 transclusions (more info) ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
 
(No difference)

Latest revision as of 18:00, 16 August 2024

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