<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3AImage_array</id>
	<title>Module:Image array - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3AImage_array"/>
	<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Image_array&amp;action=history"/>
	<updated>2026-05-07T21:53:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Image_array&amp;diff=144987&amp;oldid=prev</id>
		<title>Indicwiki: 1 revision imported from :alpha:Module:Image_array</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Image_array&amp;diff=144987&amp;oldid=prev"/>
		<updated>2023-04-29T04:23:52Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported from &lt;a href=&quot;https://alpha.indicwiki.in/index.php?title=Module:Image_array&quot; class=&quot;extiw&quot; title=&quot;alpha:Module:Image array&quot;&gt;alpha:Module:Image_array&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:53, 29 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Indicwiki</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Image_array&amp;diff=144986&amp;oldid=prev</id>
		<title>alpha&gt;Sandeep: Created page with &quot;-- implements template:image array  local p = {}  local function isnotempty(s) 	return s and s:match( '^%s*(.-)%s*$' ) ~= '' end  local function renderArrayCell( img, c, a...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Image_array&amp;diff=144986&amp;oldid=prev"/>
		<updated>2023-01-13T11:12:37Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- implements &lt;a href=&quot;/wiki/Template:Image_array&quot; title=&quot;Template:Image array&quot;&gt;template:image array&lt;/a&gt;  local p = {}  local function isnotempty(s) 	return s and s:match( &amp;#039;^%s*(.-)%s*$&amp;#039; ) ~= &amp;#039;&amp;#039; end  local function renderArrayCell( img, c, a...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- implements [[template:image array]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function isnotempty(s)&lt;br /&gt;
	return s and s:match( '^%s*(.-)%s*$' ) ~= ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function renderArrayCell( img, c, a, b, l, tc, t, w, h)&lt;br /&gt;
	local alt = isnotempty(a) and ('|alt=' .. a) or ''&lt;br /&gt;
	local link = isnotempty(l) and ('|link=' .. l) or ''&lt;br /&gt;
	local text = (isnotempty(tc) and not isnotempty(t)) &lt;br /&gt;
		and mw.text.unstrip(c) or mw.text.unstrip(t or '')&lt;br /&gt;
	local border = isnotempty(b) and '|border' or ''&lt;br /&gt;
		&lt;br /&gt;
	local cell = mw.html.create('')&lt;br /&gt;
	if( img ) then&lt;br /&gt;
		cell:tag('div')&lt;br /&gt;
			:css('display', 'table-cell')&lt;br /&gt;
			:css('vertical-align', 'middle')&lt;br /&gt;
			:css('width', w .. 'px')&lt;br /&gt;
			:css('height', h .. 'px')&lt;br /&gt;
			:css('margin-left', 'auto')&lt;br /&gt;
			:css('margin-right', 'auto')&lt;br /&gt;
			:wikitext(mw.ustring.format('[[File:%s|%dx%dpx%s|%s]]', &lt;br /&gt;
				img, w, h, alt .. link .. border, text))&lt;br /&gt;
		cell:tag('div')&lt;br /&gt;
			:css('padding', '1px')&lt;br /&gt;
			:wikitext(c)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return tostring(cell)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._imagearray( args )&lt;br /&gt;
	local width = tonumber(args['width'] or '60')&lt;br /&gt;
	local height = tonumber(args['height'] or '70')&lt;br /&gt;
	local perrow = tonumber(args['perrow'] or '4')&lt;br /&gt;
	local bw = tonumber(args['border-width'] or '0')&lt;br /&gt;
	local fs = args['font-size'] or '88%'&lt;br /&gt;
	local text = args['text'] or ''&lt;br /&gt;
	local margin = args['margin'] or 'auto'&lt;br /&gt;
	local border = ( bw &amp;gt; 0 ) and tostring(bw) .. 'px #aaa solid' or nil&lt;br /&gt;
&lt;br /&gt;
	-- find all the nonempty image numbers&lt;br /&gt;
	local imagenums = {}&lt;br /&gt;
	local imagecount = 0&lt;br /&gt;
	for k, v in pairs( args ) do&lt;br /&gt;
		local i = tonumber(tostring(k):match( '^%s*image([%d]+)%s*$' ) or '0')&lt;br /&gt;
		if( i &amp;gt; 0 and isnotempty(v) ) then&lt;br /&gt;
			table.insert( imagenums, i )&lt;br /&gt;
			imagecount = imagecount + 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- sort the image numbers&lt;br /&gt;
	table.sort(imagenums)&lt;br /&gt;
	&lt;br /&gt;
	-- compute the number of rows&lt;br /&gt;
	local rowcount = math.ceil(imagecount / perrow)&lt;br /&gt;
	&lt;br /&gt;
	if rowcount &amp;lt; 1 then&lt;br /&gt;
		return '[[Category:Pages using image array with no images]]'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- start table&lt;br /&gt;
	root = mw.html.create('table')&lt;br /&gt;
	root&lt;br /&gt;
		:addClass(args['class'])&lt;br /&gt;
		:css('border-collapse','collapse')&lt;br /&gt;
		:css('text-align','center')&lt;br /&gt;
		:css('font-size', fs)&lt;br /&gt;
		:css('line-height','1.25em')&lt;br /&gt;
		:css('margin',margin)&lt;br /&gt;
		:css('width', tostring(width*perrow) .. 'px')&lt;br /&gt;
&lt;br /&gt;
	-- loop over the images&lt;br /&gt;
	for j = 1, rowcount do&lt;br /&gt;
		local row = root:tag('tr')&lt;br /&gt;
		row:css('vertical-align', 'top')&lt;br /&gt;
		for k = 1, perrow do&lt;br /&gt;
			i = imagenums[(j-1)*perrow + k] or 0&lt;br /&gt;
			row:tag('td')&lt;br /&gt;
				:css('width', width .. 'px')&lt;br /&gt;
				:css('text-align', 'center')&lt;br /&gt;
				:css(border and 'border' or '', border or '')&lt;br /&gt;
				:wikitext(renderArrayCell( &lt;br /&gt;
					args['image' .. i], args['caption' .. i], args['alt' .. i], &lt;br /&gt;
					args['border' .. i], args['link' .. i] , &lt;br /&gt;
					args['text'], args['text' .. i] , width, height)&lt;br /&gt;
					)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
    &lt;br /&gt;
	-- end table&lt;br /&gt;
    return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
function p.array( frame )&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
    return p._imagearray( args )&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>alpha&gt;Sandeep</name></author>
	</entry>
</feed>