Module:NA: Difference between revisions

From RuneRealm Wiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "-- This module is detached from the NA template. -- It's purpose is to provide an identical feature for modules -- building tables with the Scribunto HTML library. local p = {} -- Create a new node with the content and style function p.createNode(text) return configure(mw.html.create('td'), text) end -- Add the content and style to an existing node function p.styleNode(htmlNode, text) configure(htmlNode, text) end function configure(node, text) return node :wiki...")
 
(No difference)

Latest revision as of 16:19, 15 October 2024

Module documentation
This documentation is transcluded from Template:No documentation/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:NA/doc. [edit]
-- This module is detached from the NA template.
-- It's purpose is to provide an identical feature for modules
-- building tables with the Scribunto HTML library.

local p = {}

-- Create a new node with the content and style
function p.createNode(text)
	return configure(mw.html.create('td'), text)
end

-- Add the content and style to an existing node
function p.styleNode(htmlNode, text)
	configure(htmlNode, text)
end

function configure(node, text)
	return node
		:wikitext(text)
		:attr('class', 'table-na nohighlight')
		:attr('style', 'text-align:center;')
end

return p