Module:NA

From RuneRealm Wiki

This is the current revision of this page, as edited by Alex (talk | contribs) at 16:19, 15 October 2024 (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..."). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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