<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
	<id>https://wiki.s-bou.com/index.php?action=history&amp;feed=atom&amp;title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%3AAligned_table</id>
	<title>モジュール:Aligned table - 版の履歴</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.s-bou.com/index.php?action=history&amp;feed=atom&amp;title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%3AAligned_table"/>
	<link rel="alternate" type="text/html" href="https://wiki.s-bou.com/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Aligned_table&amp;action=history"/>
	<updated>2026-04-06T05:08:42Z</updated>
	<subtitle>このウィキのこのページに関する変更履歴</subtitle>
	<generator>MediaWiki 1.36.2</generator>
	<entry>
		<id>https://wiki.s-bou.com/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Aligned_table&amp;diff=1400&amp;oldid=prev</id>
		<title>Administrator: 1版 をインポートしました</title>
		<link rel="alternate" type="text/html" href="https://wiki.s-bou.com/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Aligned_table&amp;diff=1400&amp;oldid=prev"/>
		<updated>2021-10-22T17:42:00Z</updated>

		<summary type="html">&lt;p&gt;1版 をインポートしました&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;ja&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 古い版&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年10月22日 (金) 17:42時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ja&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(相違点なし)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Administrator</name></author>
	</entry>
	<entry>
		<id>https://wiki.s-bou.com/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Aligned_table&amp;diff=1399&amp;oldid=prev</id>
		<title>ja&gt;K-iczn: en:Module:Aligned table 2017年8月20日 (日) 15:26(UTC)より</title>
		<link rel="alternate" type="text/html" href="https://wiki.s-bou.com/index.php?title=%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB:Aligned_table&amp;diff=1399&amp;oldid=prev"/>
		<updated>2017-08-21T03:25:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php?title=En:Module:Aligned_table&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;En:Module:Aligned table (存在しないページ)&quot;&gt;en:Module:Aligned table&lt;/a&gt; 2017年8月20日 (日) 15:26(UTC)より&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{aligned table}}&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;
function p.table(frame)&lt;br /&gt;
	local args = (frame.args[3] ~= nil) and frame.args or frame:getParent().args&lt;br /&gt;
	local entries = {}&lt;br /&gt;
	local colclass = {}&lt;br /&gt;
	local colstyle = {}&lt;br /&gt;
	local cols = tonumber(args['cols']) or 2&lt;br /&gt;
&lt;br /&gt;
	-- create the root table&lt;br /&gt;
	local root = mw.html.create('table')&lt;br /&gt;
&lt;br /&gt;
	-- add table style for fullwidth&lt;br /&gt;
	if isnotempty(args['fullwidth']) then&lt;br /&gt;
		root&lt;br /&gt;
			:css('width', '100%')&lt;br /&gt;
			:css('border-collapse', 'collapse')&lt;br /&gt;
			:css('border-spacing', '0px 0px')&lt;br /&gt;
			:css('border', 'none')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- add table classes&lt;br /&gt;
	if isnotempty(args['class']) then&lt;br /&gt;
		root:addClass(args['class'])&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- add table style&lt;br /&gt;
	if isnotempty(args['style']) then&lt;br /&gt;
		root:cssText(args['style'])&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- build arrays with the column styles and classes&lt;br /&gt;
	if isnotempty(args['leftright']) then&lt;br /&gt;
		colstyle[1] = 'text-align:left;'&lt;br /&gt;
		colstyle[2] = 'text-align:right;'&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1,cols do&lt;br /&gt;
		colclass[ i ] = colclass[ i ] or ''&lt;br /&gt;
		colstyle[ i ] = colstyle[ i ] or ''&lt;br /&gt;
		if isnotempty(args['colstyle']) then&lt;br /&gt;
			colstyle[ i ] = args['colstyle'] .. ';' .. colstyle[ i ]&lt;br /&gt;
		end&lt;br /&gt;
		if isnotempty(args['colalign' .. tostring(i)]) then&lt;br /&gt;
			colstyle[ i ] = 'text-align:' .. args['colalign' .. tostring(i)] .. ';' .. colstyle[ i ]&lt;br /&gt;
		elseif isnotempty(args['col' .. tostring(i) .. 'align']) then&lt;br /&gt;
			colstyle[ i ] = 'text-align:' .. args['col' .. tostring(i) .. 'align'] .. ';' .. colstyle[ i ]&lt;br /&gt;
		elseif isnotempty(args['align' .. tostring(i)]) then&lt;br /&gt;
			colstyle[ i ] = 'text-align:' .. args['align' .. tostring(i)] .. ';' .. colstyle[ i ]&lt;br /&gt;
		end&lt;br /&gt;
		if isnotempty(args['colnowrap' .. tostring(i)]) then&lt;br /&gt;
			colstyle[ i ] = 'white-space:nowrap;' .. colstyle[ i ]&lt;br /&gt;
		elseif isnotempty(args['col' .. tostring(i) .. 'nowrap']) then&lt;br /&gt;
			colstyle[ i ] = 'white-space:nowrap;' .. colstyle[ i ]&lt;br /&gt;
		elseif isnotempty(args['nowrap' .. tostring(i)]) then&lt;br /&gt;
			colstyle[ i ] = 'white-space:nowrap;' .. colstyle[ i ]&lt;br /&gt;
		end&lt;br /&gt;
		if isnotempty(args['colwidth' .. tostring(i)]) then&lt;br /&gt;
			colstyle[ i ] = 'width:' .. args['colwidth' .. tostring(i)] .. ';' .. colstyle[ i ]&lt;br /&gt;
		elseif isnotempty(args['col' .. tostring(i) .. 'width']) then&lt;br /&gt;
			colstyle[ i ] = 'width:' .. args['col' .. tostring(i) .. 'width'] .. ';' .. colstyle[ i ]&lt;br /&gt;
		elseif isnotempty(args['colwidth']) then&lt;br /&gt;
			colstyle[ i ] = 'width:' .. args['colwidth'] .. ';' .. colstyle[ i ]&lt;br /&gt;
		end&lt;br /&gt;
		if isnotempty(args['colstyle' .. tostring(i)]) then&lt;br /&gt;
			colstyle[ i ] = colstyle[ i ] .. args['colstyle' .. tostring(i)]&lt;br /&gt;
		elseif isnotempty(args['col' .. tostring(i) .. 'style']) then&lt;br /&gt;
			colstyle[ i ] = colstyle[ i ] .. args['col' .. tostring(i) .. 'style']&lt;br /&gt;
		elseif isnotempty(args['style' .. tostring(i)]) then&lt;br /&gt;
			colstyle[ i ] = colstyle[ i ] .. args['style' .. tostring(i)]&lt;br /&gt;
		end&lt;br /&gt;
		if isnotempty(args['colclass' .. tostring(i)]) then&lt;br /&gt;
			colclass[ i ] =  args['colclass' .. tostring(i)]&lt;br /&gt;
		elseif isnotempty(args['col' .. tostring(i) .. 'class']) then&lt;br /&gt;
			colclass[ i ] =  args['col' .. tostring(i) .. 'class']&lt;br /&gt;
		elseif isnotempty(args['class' .. tostring(i)]) then&lt;br /&gt;
			colclass[ i ] =  args['class' .. tostring(i)]&lt;br /&gt;
		end&lt;br /&gt;
	end&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 ) == 'number' 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;
	-- build the table content&lt;br /&gt;
	if isnotempty(args['title']) then&lt;br /&gt;
		local caption = root:tag('caption')&lt;br /&gt;
		caption:cssText(args['titlestyle'])&lt;br /&gt;
		caption:wikitext(args['title'])&lt;br /&gt;
	end&lt;br /&gt;
	if isnotempty(args['above']) then&lt;br /&gt;
		local row = root:tag('tr')&lt;br /&gt;
		local cell = row:tag('th')&lt;br /&gt;
		cell:attr('colspan', cols)&lt;br /&gt;
		cell:cssText(args['abovestyle'])&lt;br /&gt;
		cell:wikitext(args['above'])&lt;br /&gt;
	end&lt;br /&gt;
	for j=1,rows do&lt;br /&gt;
		-- start a new row&lt;br /&gt;
		local row = root:tag('tr')&lt;br /&gt;
		if isnotempty(args['rowstyle']) then&lt;br /&gt;
			row:cssText(args['rowstyle'])&lt;br /&gt;
		else&lt;br /&gt;
			row:css('vertical-align', 'top')&lt;br /&gt;
		end&lt;br /&gt;
		-- loop over the cells in the row&lt;br /&gt;
		for i=1,cols do&lt;br /&gt;
			local cell&lt;br /&gt;
			if isnotempty(args['row' .. tostring(j) .. 'header']) then&lt;br /&gt;
				cell = row:tag('th'):attr('scope','col')&lt;br /&gt;
			elseif isnotempty(args['col' .. tostring(i) .. 'header']) then&lt;br /&gt;
				cell = row:tag('th'):attr('scope','row')&lt;br /&gt;
			else&lt;br /&gt;
				cell = row:tag('td')&lt;br /&gt;
			end&lt;br /&gt;
			if args['class' .. tostring(j) .. '.' .. tostring(i)] then&lt;br /&gt;
				cell:addClass(args['class' .. tostring(j) .. '.' .. tostring(i)])&lt;br /&gt;
			else&lt;br /&gt;
				if args['rowclass' .. tostring(j)] then&lt;br /&gt;
					cell:addClass(args['rowclass' .. tostring(j)])&lt;br /&gt;
				elseif args['row' .. tostring(j) .. 'class'] then&lt;br /&gt;
					cell:addClass(args['row' .. tostring(j) .. 'class'])&lt;br /&gt;
				elseif args['rowevenclass'] and math.fmod(j,2) == 0 then&lt;br /&gt;
					cell:addClass(args['rowevenclass'])&lt;br /&gt;
				elseif args['rowoddclass'] and math.fmod(j,2) == 1 then	&lt;br /&gt;
					cell:addClass(args['rowoddclass'])&lt;br /&gt;
				end&lt;br /&gt;
				if colclass[i] ~= '' then&lt;br /&gt;
					cell:addClass(colclass[i])&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if args['style' .. tostring(j) .. '.' .. tostring(i)] then&lt;br /&gt;
				cell:cssText(args['style' .. tostring(j) .. '.' .. tostring(i)])&lt;br /&gt;
			else&lt;br /&gt;
				if args['rowstyle' .. tostring(j)] then&lt;br /&gt;
					cell:cssText(args['rowstyle' .. tostring(j)])&lt;br /&gt;
				elseif args['rowevenstyle'] and math.fmod(j,2) == 0 then&lt;br /&gt;
					cell:cssText(args['rowevenstyle'])&lt;br /&gt;
				elseif args['rowoddstyle'] and math.fmod(j,2) == 1 then	&lt;br /&gt;
					cell:cssText(args['rowoddstyle'])&lt;br /&gt;
				elseif args['row' .. tostring(j) .. 'style'] then&lt;br /&gt;
					cell:cssText(args['row' .. tostring(j) .. 'style'])&lt;br /&gt;
				end&lt;br /&gt;
				if isnotempty(colstyle[i]) then&lt;br /&gt;
					cell:cssText(colstyle[i])&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			cell:wikitext(mw.ustring.gsub(args[cols*(j - 1) + i] or '', '^(.-)%s*$', '%1') or '')&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>ja&gt;K-iczn</name></author>
	</entry>
</feed>