Jump to content

Module:Sandbox/3df

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 3df (talk | contribs) at 21:58, 13 December 2023. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}

p.main = function(frame)
	local args = frame.args
	local pargs = frame:getParent().args
	
	-- Use a thumbnail div, like an image. This part is from Module:Chessboard
	local root = mw.html.create('div')
		:addClass('thumb')
		:addClass('noviewer')
		:addClass('tright')
	local div = root:tag('div')
		:addClass('thumbinner')
		:css('width', '246px')
	local b = div:tag('table')
		:attr('cellpadding', '0')
		:attr('cellspacing', '0')
		:css('background', 'white')
		:css('font-size', '88%')
		:css('border' , '1px #c8ccd1 solid')
		:css('padding', '0')
		:css('margin', 'auto')
		
	for i = 1, 9 do
		local row = b:tag('tr')
			:css('vertical-align', 'middle')
		for j = 1, 9 do
			row:tag('td')
				:css('padding', '0')
				:css('vertical-align', 'inherit')
				:css('text-align', 'center')
				:css('width', '26px')
				:css('height', '26px')
				:css('background-color', i % 2 and 'black' or 'white')
		end
		row:tag('td')
			:css('vertical-align', 'inherit')
			:css('text-align', 'center')
			:wikitext(10-i)
	end

		
	div:tag('div'):wikitext(pargs.test)

	return tostring(root)
end
return p