உள்ளடக்கத்துக்குச் செல்

Module:Road data/browsetable

கட்டற்ற கலைக்களஞ்சியமான விக்கிப்பீடியாவில் இருந்து.
en>MusikBot II பயனரால் செய்யப்பட்ட 18:00, 16 ஆகத்து 2024 அன்றிருந்தவாரான திருத்தம் (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)))

This module exports the functions browsetable (for use from wikitext) and _browsetable (for use within Lua). The functions can serve as a container for the output of Module:Road data/browse while also adding padding between multiple instances of Module:Road data/browse.

Example

{{Box|width=20em|padding=8px|
{{#invoke:Road data/browsetable|browsetable|
{{oh browse|previous_type=SR|previous_route=222|route=OH|next_type=OH 1927|next_route=223|next_dab=1927-1930}}
{{mi browse|previous_type=M|previous_route=222|route=MI|next_type=M|next_route=227}}
}}
}}
SR 222OH SR 223
M-222MI M-227

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
"https://ta.wikipedia.org/w/index.php?title=Module:Road_data/browsetable&oldid=4228316" இலிருந்து மீள்விக்கப்பட்டது