<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ATables</id>
	<title>Module:Tables - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.runerealm.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ATables"/>
	<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Tables&amp;action=history"/>
	<updated>2026-05-01T00:42:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.runerealm.org/index.php?title=Module:Tables&amp;diff=34350&amp;oldid=prev</id>
		<title>Alex: Created page with &quot;--[[ {{Helper module |name = Tables |fname1 = _row(row, elts, header) |ftype1 = mw.html object, table/string, boolean |fuse1 = Adds &lt;code&gt;td&lt;/code&gt; or &lt;code&gt;th&lt;/code&gt; cells to the html object with the cells data specified by &lt;code&gt;elts&lt;/code&gt;. If &lt;code&gt;header&lt;/code&gt; = &lt;code&gt;true&lt;/code&gt; then all cells added will have the &lt;code&gt;th&lt;/code&gt; tag. |fname2 = _table(table, data) |ftype2 = mw.html object, table |fuse2 = Adds &lt;code&gt;tr&lt;/code&gt; rows and &lt;code&gt;td&lt;/code&gt;/&lt;code&gt;th&lt;/code&gt;...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.runerealm.org/index.php?title=Module:Tables&amp;diff=34350&amp;oldid=prev"/>
		<updated>2024-10-16T13:34:00Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--[[ {{Helper module |name = Tables |fname1 = _row(row, elts, header) |ftype1 = mw.html object, table/string, boolean |fuse1 = Adds &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt; cells to the html object with the cells data specified by &amp;lt;code&amp;gt;elts&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;header&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; then all cells added will have the &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt; tag. |fname2 = _table(table, data) |ftype2 = mw.html object, table |fuse2 = Adds &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; rows and &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt;...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
{{Helper module&lt;br /&gt;
|name = Tables&lt;br /&gt;
|fname1 = _row(row, elts, header)&lt;br /&gt;
|ftype1 = mw.html object, table/string, boolean&lt;br /&gt;
|fuse1 = Adds &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt; cells to the html object with the cells data specified by &amp;lt;code&amp;gt;elts&amp;lt;/code&amp;gt;. If &amp;lt;code&amp;gt;header&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; then all cells added will have the &amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt; tag.&lt;br /&gt;
|fname2 = _table(table, data)&lt;br /&gt;
|ftype2 = mw.html object, table&lt;br /&gt;
|fuse2 = Adds &amp;lt;code&amp;gt;tr&amp;lt;/code&amp;gt; rows and &amp;lt;code&amp;gt;td&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;th&amp;lt;/code&amp;gt; cells to the html object, the data for the rows and cells is specified by &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
-- ]]&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._row( row, elts, header )&lt;br /&gt;
    local _tag = header and &amp;#039;th&amp;#039; or &amp;#039;td&amp;#039;&lt;br /&gt;
    local ret = {}&lt;br /&gt;
    for _, v in ipairs(elts) do&lt;br /&gt;
        if type(v) == &amp;#039;table&amp;#039; then&lt;br /&gt;
            table.insert(ret,row:tag(_tag):wikitext(v.text):attr(v.attr or {}):addClass(v.class or &amp;quot;&amp;quot;):css(v.css or {}):done())&lt;br /&gt;
        else&lt;br /&gt;
            table.insert(ret,row:tag(_tag):wikitext(v):done())&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    row:done()&lt;br /&gt;
    return unpack(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._table(table, data)&lt;br /&gt;
    for _, rowdata in ipairs(data) do&lt;br /&gt;
    	if rowdata ~= false then&lt;br /&gt;
	        row = table:tag(&amp;#039;tr&amp;#039;)&lt;br /&gt;
	        for _, v in ipairs(rowdata) do&lt;br /&gt;
	            if not v then&lt;br /&gt;
	            else&lt;br /&gt;
	                row:tag(v.tag or &amp;#039;td&amp;#039;):wikitext(v.text):attr(v.attr or {}):addClass(v.class or &amp;quot;&amp;quot;):css(v.css or {}):done()&lt;br /&gt;
	            end&lt;br /&gt;
	        end&lt;br /&gt;
	        row:done()&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Alex</name></author>
	</entry>
</feed>