<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AAirport_destination_list</id>
	<title>Module:Airport destination list - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3AAirport_destination_list"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Airport_destination_list&amp;action=history"/>
	<updated>2026-04-16T20:19:51Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Airport_destination_list&amp;diff=135194&amp;oldid=prev</id>
		<title>imported&gt;JJMC89: add 3rdcolunsortable and 4thcolunsortable parameters per request</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Airport_destination_list&amp;diff=135194&amp;oldid=prev"/>
		<updated>2017-09-10T02:27:28Z</updated>

		<summary type="html">&lt;p&gt;add 3rdcolunsortable and 4thcolunsortable parameters per request&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
local function isnotempty(s)&lt;br /&gt;
	return s and s:match( &amp;#039;^%s*(.-)%s*$&amp;#039; ) ~= &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function p.table(frame)&lt;br /&gt;
	local args = (frame.args[1] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	local cols&lt;br /&gt;
	if isnotempty(args[&amp;#039;4thcoltitle&amp;#039;]) and isnotempty(args[&amp;#039;3rdcoltitle&amp;#039;]) then&lt;br /&gt;
		cols = 4&lt;br /&gt;
	elseif isnotempty(args[&amp;#039;3rdcoltitle&amp;#039;]) then cols = 3&lt;br /&gt;
	else cols = 2&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- compute the maximum cell index&lt;br /&gt;
	local cellcount = 0&lt;br /&gt;
	for k, v in pairs( args ) do&lt;br /&gt;
		if type( k ) == &amp;#039;number&amp;#039; and isnotempty(v) then&lt;br /&gt;
			cellcount = math.max(cellcount, k)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- compute the number of rows&lt;br /&gt;
	local rows = math.ceil(cellcount / cols)&lt;br /&gt;
&lt;br /&gt;
	-- create the root table&lt;br /&gt;
	local root = mw.html.create(&amp;#039;table&amp;#039;)&lt;br /&gt;
	root&lt;br /&gt;
		:addClass(&amp;#039;wikitable&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;sortable&amp;#039;)&lt;br /&gt;
		:css(&amp;#039;font-size&amp;#039;, &amp;#039;95%&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
	-- add the header row&lt;br /&gt;
	local row = root:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
	local cell= row:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
	cell:wikitext(&amp;#039;Airlines&amp;#039;)&lt;br /&gt;
	cell= row:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
	cell:addClass(&amp;#039;unsortable&amp;#039;)&lt;br /&gt;
	cell:wikitext(&amp;#039;Destinations&amp;#039;)&lt;br /&gt;
	if (isnotempty(args[&amp;#039;3rdcoltitle&amp;#039;])) then&lt;br /&gt;
		cell= row:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
		cell:css(&amp;#039;width&amp;#039;,&amp;#039;10%&amp;#039;)&lt;br /&gt;
		if (isnotempty(args[&amp;#039;3rdcolunsortable&amp;#039;])) then&lt;br /&gt;
			cell:addClass(&amp;#039;unsortable&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		cell:wikitext(args[&amp;#039;3rdcoltitle&amp;#039;])&lt;br /&gt;
	end&lt;br /&gt;
	if (isnotempty(args[&amp;#039;4thcoltitle&amp;#039;])) then&lt;br /&gt;
		cell= row:tag(&amp;#039;th&amp;#039;)&lt;br /&gt;
		if (isnotempty(args[&amp;#039;4thcolunsortable&amp;#039;])) then&lt;br /&gt;
			cell:addClass(&amp;#039;unsortable&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		cell:wikitext(args[&amp;#039;4thcoltitle&amp;#039;])&lt;br /&gt;
	end&lt;br /&gt;
	-- loop over rows&lt;br /&gt;
	for j=1,rows do&lt;br /&gt;
		row = root:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
		for i=1,cols do&lt;br /&gt;
			cell= row:tag(&amp;#039;td&amp;#039;)&lt;br /&gt;
			if (i &amp;gt; 2) then cell:css(&amp;#039;text-align&amp;#039;,&amp;#039;center&amp;#039;) end&lt;br /&gt;
			cell:wikitext(args[cols*(j - 1) + i] or &amp;#039;&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- return the root table&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;JJMC89</name></author>
	</entry>
</feed>