CINXE.COM
View source for Module:TableTools - Wikisource, the free online library
<!DOCTYPE html> <html class="client-nojs" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>View source for Module:TableTools - Wikisource, the free online library</title> <script>(function(){var className="client-js";var cookie=document.cookie.match(/(?:^|; )enwikisourcemwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":true,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"fa1415d3-f9fb-4567-acd4-9c3e65bcf5de","wgCanonicalNamespace":"Module","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":828,"wgPageName":"Module:TableTools","wgTitle":"TableTools","wgCurRevisionId":14517881,"wgRevisionId":0,"wgArticleId":1633280,"wgIsArticle":false,"wgIsRedirect":false,"wgAction":"edit","wgUserName":null,"wgUserGroups":["*"],"wgCategories": [],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"Scribunto","wgRelevantPageName":"Module:TableTools","wgRelevantArticleId":1633280,"wgIsProbablyEditable":false,"wgRelevantPageIsProbablyEditable":false,"wgRestrictionEdit":["sysop"],"wgRestrictionMove":["sysop"],"wgNoticeProject":"wikisource","wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":20000,"wgCodeEditorCurrentLanguage":"lua","prpProofreadPageBookNamespaces":[0,0,114],"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgCheckUserClientHintsHeadersJsApi":["brands", "architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"ext.gadget.Site-styles":"ready","ext.gadget.MoreMenu-local-pagestyles":"ready","ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.codeEditor.styles":"ready","skins.vector.styles.legacy":"ready","ext.charinsert.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","codex-search-styles":"ready","ext.uls.interlanguage":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.codeEditor","ext.scribunto.edit","mediawiki.action.edit.collapsibleFooter","site","mediawiki.page.ready","skins.vector.legacy.js","ext.centralNotice.geoIP","ext.charinsert","ext.gadget.charinsert","ext.gadget.Easy_LST","ext.gadget.Fill_Index","ext.gadget.IndexFormTools","ext.gadget.Site","ext.gadget.prefill-template-preview","ext.gadget.PageNumbers","ext.gadget.MoreMenu-local", "ext.gadget.PurgeTab","ext.gadget.interwiki-transclusion","ext.gadget.extra-toolbar-buttons","ext.urlShortener.toolbar","ext.centralauth.centralautologin","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.checkUser.clientHints","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=codex-search-styles%7Cext.charinsert.styles%7Cext.codeEditor.styles%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cskins.vector.styles.legacy&only=styles&skin=vector"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.gadget.MoreMenu-local-pagestyles%2CSite-styles&only=styles&skin=vector"> <meta name="generator" content="MediaWiki 1.44.0-wmf.5"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="noindex,nofollow,max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="View source for Module:TableTools - Wikisource, the free online library"> <meta property="og:type" content="website"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//en.m.wikisource.org/wiki/Module:TableTools"> <link rel="icon" href="/static/favicon/wikisource.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikisource (en)"> <link rel="EditURI" type="application/rsd+xml" href="//en.wikisource.org/w/api.php?action=rsd"> <link rel="canonical" href="https://en.wikisource.org/wiki/Module:TableTools"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en"> <link rel="alternate" type="application/atom+xml" title="Wikisource Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="codeeditor-loading skin-vector-legacy mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-828 ns-subject page-Module_TableTools rootpage-Module_TableTools skin-vector action-edit"><div id="mw-page-base" class="noprint"></div> <div id="mw-head-base" class="noprint"></div> <div id="content" class="mw-body" role="main"> <a id="top"></a> <div id="siteNotice"><!-- CentralNotice --></div> <div class="mw-indicators"> </div> <h1 id="firstHeading" class="firstHeading mw-first-heading">View source for Module:TableTools</h1> <div id="bodyContent" class="vector-body"> <div id="contentSub"><div id="mw-content-subtitle">← <a href="/wiki/Module:TableTools" title="Module:TableTools">Module:TableTools</a></div></div> <div id="contentSub2"></div> <div id="jump-to-nav"></div> <a class="mw-jump-link" href="#mw-head">Jump to navigation</a> <a class="mw-jump-link" href="#searchInput">Jump to search</a> <div id="mw-content-text" class="mw-body-content"><p>You do not have permission to edit this page, for the following reasons: </p> <ul class="permissions-errors"><li class="mw-permissionerror-protectedpagetext">This page has been protected to prevent editing or other actions.</li><li class="mw-permissionerror-globalblocking-blockedtext-range"><b>Your IP address is in a range that has been <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Global_blocks" class="extiw" title="m:Special:MyLanguage/Global blocks">blocked on all Wikimedia Foundation wikis</a>.</b> The block was made by <a href="/wiki/User:Jon_Kolbert" title="User:Jon Kolbert">Jon Kolbert</a>. The reason given is <i><a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/NOP" class="extiw" title="m:Special:MyLanguage/NOP">Open proxy/Webhost</a>: See the <a href="https://meta.wikimedia.org/wiki/WM:OP/H" class="extiw" title="m:WM:OP/H">help page</a> if you are affected </i>. <ul><li>Start of block: 15:12, 27 August 2023</li> <li>Expiry of block: 15:12, 27 August 2028</li></ul> Your current IP address is 8.222.208.146. The blocked range is 8.222.128.0/17. Please include all above details in any queries you make. If you believe you were blocked by mistake, you can find additional information and instructions in the <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/No_open_proxies" class="extiw" title="m:Special:MyLanguage/No open proxies">No open proxies</a> global policy. Otherwise, to discuss the block please <a href="https://meta.wikimedia.org/wiki/Steward_requests/Global" class="extiw" title="m:Steward requests/Global">post a request for review on Meta-Wiki</a>. You could also send an email to the <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/Stewards" class="extiw" title="m:Special:MyLanguage/Stewards">stewards</a> <a href="https://meta.wikimedia.org/wiki/Special:MyLanguage/VRT" class="extiw" title="m:Special:MyLanguage/VRT">VRT</a> queue at <kbd>stewards@wikimedia.org</kbd> including all above details.</li></ul><hr /> <p>You can view and copy the source of this page. </p><textarea readonly="" accesskey="," id="wpTextbox1" cols="80" rows="25" style="" class="mw-editfont-monospace" lang="en" dir="ltr" name="wpTextbox1">------------------------------------------------------------------------------------ -- TableTools -- -- -- -- This module includes a number of functions for dealing with Lua tables. -- -- It is a meta-module, meant to be called from other Lua modules, and should not -- -- be called directly from #invoke. -- ------------------------------------------------------------------------------------ local libraryUtil = require('libraryUtil') local p = {} -- Define often-used variables and functions. local floor = math.floor local infinity = math.huge local checkType = libraryUtil.checkType local checkTypeMulti = libraryUtil.checkTypeMulti ------------------------------------------------------------------------------------ -- isPositiveInteger -- -- This function returns true if the given value is a positive integer, and false -- if not. Although it doesn't operate on tables, it is included here as it is -- useful for determining whether a given table key is in the array part or the -- hash part of a table. ------------------------------------------------------------------------------------ function p.isPositiveInteger(v) return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity end ------------------------------------------------------------------------------------ -- isNan -- -- This function returns true if the given number is a NaN value, and false if -- not. Although it doesn't operate on tables, it is included here as it is useful -- for determining whether a value can be a valid table key. Lua will generate an -- error if a NaN is used as a table key. ------------------------------------------------------------------------------------ function p.isNan(v) return type(v) == 'number' and v ~= v end ------------------------------------------------------------------------------------ -- shallowClone -- -- This returns a clone of a table. The value returned is a new table, but all -- subtables and functions are shared. Metamethods are respected, but the returned -- table will have no metatable of its own. ------------------------------------------------------------------------------------ function p.shallowClone(t) checkType('shallowClone', 1, t, 'table') local ret = {} for k, v in pairs(t) do ret[k] = v end return ret end ------------------------------------------------------------------------------------ -- removeDuplicates -- -- This removes duplicate values from an array. Non-positive-integer keys are -- ignored. The earliest value is kept, and all subsequent duplicate values are -- removed, but otherwise the array order is unchanged. ------------------------------------------------------------------------------------ function p.removeDuplicates(arr) checkType('removeDuplicates', 1, arr, 'table') local isNan = p.isNan local ret, exists = {}, {} for _, v in ipairs(arr) do if isNan(v) then -- NaNs can't be table keys, and they are also unique, so we don't need to check existence. ret[#ret + 1] = v elseif not exists[v] then ret[#ret + 1] = v exists[v] = true end end return ret end ------------------------------------------------------------------------------------ -- numKeys -- -- This takes a table and returns an array containing the numbers of any numerical -- keys that have non-nil values, sorted in numerical order. ------------------------------------------------------------------------------------ function p.numKeys(t) checkType('numKeys', 1, t, 'table') local isPositiveInteger = p.isPositiveInteger local nums = {} for k in pairs(t) do if isPositiveInteger(k) then nums[#nums + 1] = k end end table.sort(nums) return nums end ------------------------------------------------------------------------------------ -- affixNums -- -- This takes a table and returns an array containing the numbers of keys with the -- specified prefix and suffix. For example, for the table -- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will return -- {1, 3, 6}. ------------------------------------------------------------------------------------ function p.affixNums(t, prefix, suffix) checkType('affixNums', 1, t, 'table') checkType('affixNums', 2, prefix, 'string', true) checkType('affixNums', 3, suffix, 'string', true) local function cleanPattern(s) -- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally. return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1') end prefix = prefix or '' suffix = suffix or '' prefix = cleanPattern(prefix) suffix = cleanPattern(suffix) local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$' local nums = {} for k in pairs(t) do if type(k) == 'string' then local num = mw.ustring.match(k, pattern) if num then nums[#nums + 1] = tonumber(num) end end end table.sort(nums) return nums end ------------------------------------------------------------------------------------ -- numData -- -- Given a table with keys like {"foo1", "bar1", "foo2", "baz2"}, returns a table -- of subtables in the format -- {[1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'}}. -- Keys that don't end with an integer are stored in a subtable named "other". The -- compress option compresses the table so that it can be iterated over with -- ipairs. ------------------------------------------------------------------------------------ function p.numData(t, compress) checkType('numData', 1, t, 'table') checkType('numData', 2, compress, 'boolean', true) local ret = {} for k, v in pairs(t) do local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$') if num then num = tonumber(num) local subtable = ret[num] or {} if prefix == '' then -- Positional parameters match the blank string; put them at the start of the subtable instead. prefix = 1 end subtable[prefix] = v ret[num] = subtable else local subtable = ret.other or {} subtable[k] = v ret.other = subtable end end if compress then local other = ret.other ret = p.compressSparseArray(ret) ret.other = other end return ret end ------------------------------------------------------------------------------------ -- compressSparseArray -- -- This takes an array with one or more nil values, and removes the nil values -- while preserving the order, so that the array can be safely traversed with -- ipairs. ------------------------------------------------------------------------------------ function p.compressSparseArray(t) checkType('compressSparseArray', 1, t, 'table') local ret = {} local nums = p.numKeys(t) for _, num in ipairs(nums) do ret[#ret + 1] = t[num] end return ret end ------------------------------------------------------------------------------------ -- sparseIpairs -- -- This is an iterator for sparse arrays. It can be used like ipairs, but can -- handle nil values. ------------------------------------------------------------------------------------ function p.sparseIpairs(t) checkType('sparseIpairs', 1, t, 'table') local nums = p.numKeys(t) local i = 0 local lim = #nums return function () i = i + 1 if i <= lim then local key = nums[i] return key, t[key] else return nil, nil end end end ------------------------------------------------------------------------------------ -- size -- -- This returns the size of a key/value pair table. It will also work on arrays, -- but for arrays it is more efficient to use the # operator. ------------------------------------------------------------------------------------ function p.size(t) checkType('size', 1, t, 'table') local i = 0 for _ in pairs(t) do i = i + 1 end return i end local function defaultKeySort(item1, item2) -- "number" < "string", so numbers will be sorted before strings. local type1, type2 = type(item1), type(item2) if type1 ~= type2 then return type1 < type2 elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then return tostring(item1) < tostring(item2) else return item1 < item2 end end ------------------------------------------------------------------------------------ -- keysToList -- -- Returns an array of the keys in a table, sorted using either a default -- comparison function or a custom keySort function. ------------------------------------------------------------------------------------ function p.keysToList(t, keySort, checked) if not checked then checkType('keysToList', 1, t, 'table') checkTypeMulti('keysToList', 2, keySort, {'function', 'boolean', 'nil'}) end local arr = {} local index = 1 for k in pairs(t) do arr[index] = k index = index + 1 end if keySort ~= false then keySort = type(keySort) == 'function' and keySort or defaultKeySort table.sort(arr, keySort) end return arr end ------------------------------------------------------------------------------------ -- sortedPairs -- -- Iterates through a table, with the keys sorted using the keysToList function. -- If there are only numerical keys, sparseIpairs is probably more efficient. ------------------------------------------------------------------------------------ function p.sortedPairs(t, keySort) checkType('sortedPairs', 1, t, 'table') checkType('sortedPairs', 2, keySort, 'function', true) local arr = p.keysToList(t, keySort, true) local i = 0 return function () i = i + 1 local key = arr[i] if key ~= nil then return key, t[key] else return nil, nil end end end ------------------------------------------------------------------------------------ -- isArray -- -- Returns true if the given value is a table and all keys are consecutive -- integers starting at 1. ------------------------------------------------------------------------------------ function p.isArray(v) if type(v) ~= 'table' then return false end local i = 0 for _ in pairs(v) do i = i + 1 if v[i] == nil then return false end end return true end ------------------------------------------------------------------------------------ -- isArrayLike -- -- Returns true if the given value is iterable and all keys are consecutive -- integers starting at 1. ------------------------------------------------------------------------------------ function p.isArrayLike(v) if not pcall(pairs, v) then return false end local i = 0 for _ in pairs(v) do i = i + 1 if v[i] == nil then return false end end return true end ------------------------------------------------------------------------------------ -- invert -- -- Transposes the keys and values in an array. For example, {"a", "b", "c"} -> -- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to -- the index of the last duplicate) and NaN values are ignored. ------------------------------------------------------------------------------------ function p.invert(arr) checkType("invert", 1, arr, "table") local isNan = p.isNan local map = {} for i, v in ipairs(arr) do if not isNan(v) then map[v] = i end end return map end ------------------------------------------------------------------------------------ -- listToSet -- -- Creates a set from the array part of the table. Indexing the set by any of the -- values of the array returns true. For example, {"a", "b", "c"} -> -- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them -- never equal to any value (including other NaNs or even themselves). ------------------------------------------------------------------------------------ function p.listToSet(arr) checkType("listToSet", 1, arr, "table") local isNan = p.isNan local set = {} for _, v in ipairs(arr) do if not isNan(v) then set[v] = true end end return set end ------------------------------------------------------------------------------------ -- deepCopy -- -- Recursive deep copy function. Preserves identities of subtables. ------------------------------------------------------------------------------------ local function _deepCopy(orig, includeMetatable, already_seen) if type(orig) ~= "table" then return orig end -- already_seen stores copies of tables indexed by the original table. local copy = already_seen[orig] if copy ~= nil then return copy end copy = {} already_seen[orig] = copy -- memoize before any recursion, to avoid infinite loops for orig_key, orig_value in pairs(orig) do copy[_deepCopy(orig_key, includeMetatable, already_seen)] = _deepCopy(orig_value, includeMetatable, already_seen) end if includeMetatable then local mt = getmetatable(orig) if mt ~= nil then setmetatable(copy, _deepCopy(mt, true, already_seen)) end end return copy end function p.deepCopy(orig, noMetatable, already_seen) checkType("deepCopy", 3, already_seen, "table", true) return _deepCopy(orig, not noMetatable, already_seen or {}) end ------------------------------------------------------------------------------------ -- sparseConcat -- -- Concatenates all values in the table that are indexed by a number, in order. -- sparseConcat{a, nil, c, d} => "acd" -- sparseConcat{nil, b, c, d} => "bcd" ------------------------------------------------------------------------------------ function p.sparseConcat(t, sep, i, j) local arr = {} local arr_i = 0 for _, v in p.sparseIpairs(t) do arr_i = arr_i + 1 arr[arr_i] = v end return table.concat(arr, sep, i, j) end ------------------------------------------------------------------------------------ -- length -- -- Finds the length of an array, or of a quasi-array with keys such as "data1", -- "data2", etc., using an exponential search algorithm. It is similar to the -- operator #, but may return a different value when there are gaps in the array -- portion of the table. Intended to be used on data loaded with mw.loadData. For -- other tables, use #. -- Note: #frame.args in frame object always be set to 0, regardless of the number -- of unnamed template parameters, so use this function for frame.args. ------------------------------------------------------------------------------------ function p.length(t, prefix) -- requiring module inline so that [[Module:Exponential search]] which is -- only needed by this one function doesn't get millions of transclusions local expSearch = require("Module:Exponential search") checkType('length', 1, t, 'table') checkType('length', 2, prefix, 'string', true) return expSearch(function (i) local key if prefix then key = prefix .. tostring(i) else key = i end return t[key] ~= nil end) or 0 end ------------------------------------------------------------------------------------ -- inArray -- -- Returns true if searchElement is a member of the array, and false otherwise. -- Equivalent to JavaScript array.includes(searchElement) or -- array.includes(searchElement, fromIndex), except fromIndex is 1 indexed ------------------------------------------------------------------------------------ function p.inArray(array, searchElement, fromIndex) checkType("inArray", 1, array, "table") -- if searchElement is nil, error? fromIndex = tonumber(fromIndex) if fromIndex then if (fromIndex < 0) then fromIndex = #array + fromIndex + 1 end if fromIndex < 1 then fromIndex = 1 end for _, v in ipairs({unpack(array, fromIndex)}) do if v == searchElement then return true end end else for _, v in pairs(array) do if v == searchElement then return true end end end return false end ------------------------------------------------------------------------------------ -- merge -- -- Given the arrays, returns an array containing the elements of each input array -- in sequence. ------------------------------------------------------------------------------------ function p.merge(...) local arrays = {...} local ret = {} for i, arr in ipairs(arrays) do checkType('merge', i, arr, 'table') for _, v in ipairs(arr) do ret[#ret + 1] = v end end return ret end ------------------------------------------------------------------------------------ -- extend -- -- Extends the first array in place by appending all elements from the second -- array. ------------------------------------------------------------------------------------ function p.extend(arr1, arr2) checkType('extend', 1, arr1, 'table') checkType('extend', 2, arr2, 'table') for _, v in ipairs(arr2) do arr1[#arr1 + 1] = v end end return p </textarea><div id="mw-scribunto-console"></div><div class="templatesUsed"><div class="mw-templatesUsedExplanation"><p>Templates used on this page: </p></div><ul> <li><a href="/wiki/Template:Code" title="Template:Code">Template:Code</a> (<a href="/w/index.php?title=Template:Code&action=edit" title="Template:Code">edit</a>) </li><li><a href="/wiki/Template:Documentation" title="Template:Documentation">Template:Documentation</a> (<a href="/w/index.php?title=Template:Documentation&action=edit" title="Template:Documentation">edit</a>) </li><li><a href="/wiki/Template:High-risk" class="mw-redirect" title="Template:High-risk">Template:High-risk</a> (<a href="/w/index.php?title=Template:High-risk&action=edit" class="mw-redirect" title="Template:High-risk">edit</a>) </li><li><a href="/wiki/Template:High-use" title="Template:High-use">Template:High-use</a> (<a href="/w/index.php?title=Template:High-use&action=edit" title="Template:High-use">edit</a>) </li><li><a href="/wiki/Template:Lua" title="Template:Lua">Template:Lua</a> (<a href="/w/index.php?title=Template:Lua&action=edit" title="Template:Lua">edit</a>) </li><li><a href="/wiki/Template:Ml" class="mw-redirect" title="Template:Ml">Template:Ml</a> (<a href="/w/index.php?title=Template:Ml&action=edit" class="mw-redirect" title="Template:Ml">edit</a>) </li><li><a href="/wiki/Template:Module_link" title="Template:Module link">Template:Module link</a> (<a href="/w/index.php?title=Template:Module_link&action=edit" title="Template:Module link">edit</a>) </li><li><a href="/wiki/Template:Sandbox_other" title="Template:Sandbox other">Template:Sandbox other</a> (<a href="/w/index.php?title=Template:Sandbox_other&action=edit" title="Template:Sandbox other">edit</a>) </li><li><a href="/wiki/Module:Arguments" title="Module:Arguments">Module:Arguments</a> (<a href="/w/index.php?title=Module:Arguments&action=edit" title="Module:Arguments">view source</a>) (protected)</li><li><a href="/wiki/Module:Documentation" title="Module:Documentation">Module:Documentation</a> (<a href="/w/index.php?title=Module:Documentation&action=edit" title="Module:Documentation">edit</a>) </li><li><a href="/wiki/Module:Documentation/config" title="Module:Documentation/config">Module:Documentation/config</a> (<a href="/w/index.php?title=Module:Documentation/config&action=edit" title="Module:Documentation/config">edit</a>) </li><li><a href="/wiki/Module:Documentation/styles.css" title="Module:Documentation/styles.css">Module:Documentation/styles.css</a> (<a href="/w/index.php?title=Module:Documentation/styles.css&action=edit" title="Module:Documentation/styles.css">edit</a>) </li><li><a href="/wiki/Module:Effective_protection_expiry" title="Module:Effective protection expiry">Module:Effective protection expiry</a> (<a href="/w/index.php?title=Module:Effective_protection_expiry&action=edit" title="Module:Effective protection expiry">view source</a>) (semi-protected)</li><li><a href="/wiki/Module:Effective_protection_level" title="Module:Effective protection level">Module:Effective protection level</a> (<a href="/w/index.php?title=Module:Effective_protection_level&action=edit" title="Module:Effective protection level">edit</a>) </li><li><a href="/wiki/Module:File_link" title="Module:File link">Module:File link</a> (<a href="/w/index.php?title=Module:File_link&action=edit" title="Module:File link">edit</a>) </li><li><a href="/wiki/Module:High-use" title="Module:High-use">Module:High-use</a> (<a href="/w/index.php?title=Module:High-use&action=edit" title="Module:High-use">edit</a>) </li><li><a href="/wiki/Module:List" title="Module:List">Module:List</a> (<a href="/w/index.php?title=Module:List&action=edit" title="Module:List">view source</a>) (semi-protected)</li><li><a href="/wiki/Module:Lua_banner" title="Module:Lua banner">Module:Lua banner</a> (<a href="/w/index.php?title=Module:Lua_banner&action=edit" title="Module:Lua banner">view source</a>) (semi-protected)</li><li><a href="/wiki/Module:Message_box" title="Module:Message box">Module:Message box</a> (<a href="/w/index.php?title=Module:Message_box&action=edit" title="Module:Message box">view source</a>) (protected)</li><li><a href="/wiki/Module:Message_box/configuration" title="Module:Message box/configuration">Module:Message box/configuration</a> (<a href="/w/index.php?title=Module:Message_box/configuration&action=edit" title="Module:Message box/configuration">view source</a>) (protected)</li><li><a href="/wiki/Module:Message_box/ombox.css" title="Module:Message box/ombox.css">Module:Message box/ombox.css</a> (<a href="/w/index.php?title=Module:Message_box/ombox.css&action=edit" title="Module:Message box/ombox.css">view source</a>) (protected)</li><li><a href="/wiki/Module:Protection_banner" title="Module:Protection banner">Module:Protection banner</a> (<a href="/w/index.php?title=Module:Protection_banner&action=edit" title="Module:Protection banner">edit</a>) </li><li><a href="/wiki/Module:Protection_banner/config" title="Module:Protection banner/config">Module:Protection banner/config</a> (<a href="/w/index.php?title=Module:Protection_banner/config&action=edit" title="Module:Protection banner/config">view source</a>) (semi-protected)</li><li><a href="/wiki/Module:Separated_entries" title="Module:Separated entries">Module:Separated entries</a> (<a href="/w/index.php?title=Module:Separated_entries&action=edit" title="Module:Separated entries">edit</a>) </li><li><a href="/wiki/Module:String" title="Module:String">Module:String</a> (<a href="/w/index.php?title=Module:String&action=edit" title="Module:String">view source</a>) (protected)</li><li><a href="/wiki/Module:TableTools" title="Module:TableTools">Module:TableTools</a> (<a href="/w/index.php?title=Module:TableTools&action=edit" title="Module:TableTools">view source</a>) (protected)</li><li><a href="/wiki/Module:TableTools/doc" title="Module:TableTools/doc">Module:TableTools/doc</a> (<a href="/w/index.php?title=Module:TableTools/doc&action=edit" title="Module:TableTools/doc">edit</a>) </li><li><a href="/wiki/Module:Transclusion_count" title="Module:Transclusion count">Module:Transclusion count</a> (<a href="/w/index.php?title=Module:Transclusion_count&action=edit" title="Module:Transclusion count">edit</a>) </li><li><a href="/w/index.php?title=Module:Transclusion_count/data/T&action=edit&redlink=1" class="new" title="Module:Transclusion count/data/T (page does not exist)">Module:Transclusion count/data/T</a> (<a href="/w/index.php?title=Module:Transclusion_count/data/T&action=edit" class="new" title="Module:Transclusion count/data/T (page does not exist)">edit</a>) </li><li><a href="/wiki/Module:Yesno" title="Module:Yesno">Module:Yesno</a> (<a href="/w/index.php?title=Module:Yesno&action=edit" title="Module:Yesno">view source</a>) (protected)</li></ul></div><p id="mw-returnto">Return to <a href="/wiki/Module:TableTools" title="Module:TableTools">Module:TableTools</a>.</p> <!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1&useformat=desktop" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://en.wikisource.org/wiki/Module:TableTools">https://en.wikisource.org/wiki/Module:TableTools</a>"</div></div> <div id="catlinks" class="catlinks catlinks-allhidden" data-mw="interface"></div> </div> </div> <div id="mw-navigation"> <h2>Navigation menu</h2> <div id="mw-head"> <nav id="p-personal" class="mw-portlet mw-portlet-personal vector-user-menu-legacy vector-menu" aria-labelledby="p-personal-label" > <h3 id="p-personal-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Personal tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anonuserpage" class="mw-list-item"><span title="The user page for the IP address you are editing as">Not logged in</span></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li><li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-createaccount" class="mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=Module%3ATableTools&returntoquery=action%3Dedit" title="You are encouraged to create an account and log in; however, it is not mandatory"><span>Create account</span></a></li><li id="pt-login" class="mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Module%3ATableTools&returntoquery=action%3Dedit" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span>Log in</span></a></li> </ul> </div> </nav> <div id="left-navigation"> <nav id="p-namespaces" class="mw-portlet mw-portlet-namespaces vector-menu-tabs vector-menu-tabs-legacy vector-menu" aria-labelledby="p-namespaces-label" > <h3 id="p-namespaces-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Namespaces</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-module" class="selected mw-list-item"><a href="/wiki/Module:TableTools" title="View the module page [c]" accesskey="c"><span>Module</span></a></li><li id="ca-talk" class="new mw-list-item"><a href="/w/index.php?title=Module_talk:TableTools&action=edit&redlink=1" rel="discussion" class="new" title="Discussion about the content page (page does not exist) [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </nav> <nav id="p-variants" class="mw-portlet mw-portlet-variants emptyPortlet vector-menu-dropdown vector-menu" aria-labelledby="p-variants-label" > <input type="checkbox" id="p-variants-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-variants" class="vector-menu-checkbox" aria-labelledby="p-variants-label" > <label id="p-variants-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">English</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> </div> <div id="right-navigation"> <nav id="p-views" class="mw-portlet mw-portlet-views vector-menu-tabs vector-menu-tabs-legacy vector-menu" aria-labelledby="p-views-label" > <h3 id="p-views-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Views</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="mw-list-item"><a href="/wiki/Module:TableTools"><span>Read</span></a></li><li id="ca-viewsource" class="selected mw-list-item"><a href="/w/index.php?title=Module:TableTools&action=edit" title="This page is protected. You can view its source [e]" accesskey="e"><span>View source</span></a></li><li id="ca-history" class="mw-list-item"><a href="/w/index.php?title=Module:TableTools&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </nav> <nav id="p-cactions" class="mw-portlet mw-portlet-cactions emptyPortlet vector-menu-dropdown vector-menu" aria-labelledby="p-cactions-label" title="More options" > <input type="checkbox" id="p-cactions-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-cactions" class="vector-menu-checkbox" aria-labelledby="p-cactions-label" > <label id="p-cactions-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">More</span> </label> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <h3 >Search</h3> <form action="/w/index.php" id="searchform" class="vector-search-box-form"> <div id="simpleSearch" class="vector-search-box-inner" data-search-loc="header-navigation"> <input class="vector-search-box-input" type="search" name="search" placeholder="Search Wikisource" aria-label="Search Wikisource" autocapitalize="sentences" title="Search Wikisource [f]" accesskey="f" id="searchInput" > <input type="hidden" name="title" value="Special:Search"> <input id="mw-searchButton" class="searchButton mw-fallbackSearchButton" type="submit" name="fulltext" title="Search the pages for this text" value="Search"> <input id="searchButton" class="searchButton" type="submit" name="go" title="Go to a page with this exact name if it exists" value="Go"> </div> </form> </div> </div> </div> <div id="mw-panel" class="vector-legacy-sidebar"> <div id="p-logo" role="banner"> <a class="mw-wiki-logo" href="/wiki/Main_Page" title="Visit the main page"></a> </div> <nav id="p-navigation" class="mw-portlet mw-portlet-navigation vector-menu-portal portal vector-menu" aria-labelledby="p-navigation-label" > <h3 id="p-navigation-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Navigation</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage" class="mw-list-item"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z"><span>Main Page</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikisource:Community_portal" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li><li id="n-scriptorium" class="mw-list-item"><a href="/wiki/Wikisource:Scriptorium"><span>Central discussion</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-subjectindex" class="mw-list-item"><a href="/wiki/Portal:Portals"><span>Subject index</span></a></li><li id="n-categoryauthors" class="mw-list-item"><a href="/wiki/Category:Authors_by_alphabetical_order"><span>Authors</span></a></li><li id="n-randomwork" class="mw-list-item"><a href="/wiki/Special:RandomRootpage/Main"><span>Random work</span></a></li><li id="n-randomauthor" class="mw-list-item"><a href="/wiki/Special:RandomRootpage/Author"><span>Random author</span></a></li><li id="n-randomindex" class="mw-list-item"><a href="/wiki/Special:RandomRootpage/Index"><span>Random transcription</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/Help:Contents" title="The place to find out"><span>Help</span></a></li><li id="n-sitesupport" class="mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikisource.org&uselang=en" title="Support us"><span>Donate</span></a></li> </ul> </div> </nav> <nav id="p-do" class="mw-portlet mw-portlet-do emptyPortlet vector-menu-portal portal vector-menu" aria-labelledby="p-do-label" > <h3 id="p-do-label" class="vector-menu-heading " > <span class="vector-menu-heading-label"></span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </nav> <nav id="p-tb" class="mw-portlet mw-portlet-tb vector-menu-portal portal vector-menu" aria-labelledby="p-tb-label" > <h3 id="p-tb-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">Tools</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Module:TableTools" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Module:TableTools" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Module:TableTools&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fen.wikisource.org%2Fw%2Findex.php%3Ftitle%3DModule%3ATableTools%26action%3Dedit"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fen.wikisource.org%2Fw%2Findex.php%3Ftitle%3DModule%3ATableTools%26action%3Dedit"><span>Download QR code</span></a></li> </ul> </div> </nav> <nav id="p-wikibase-otherprojects" class="mw-portlet mw-portlet-wikibase-otherprojects vector-menu-portal portal vector-menu" aria-labelledby="p-wikibase-otherprojects-label" > <h3 id="p-wikibase-otherprojects-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">In other projects</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q15408619" title="Link to connected data repository item [g]" accesskey="g"><span>Wikidata item</span></a></li> </ul> </div> </nav> <nav id="p-lang" class="mw-portlet mw-portlet-lang vector-menu-portal portal vector-menu" aria-labelledby="p-lang-label" > <h3 id="p-lang-label" class="vector-menu-heading " > <span class="vector-menu-heading-label">In other languages</span> </h3> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"><span class="uls-after-portlet-link"></span></div> </div> </nav> </div> </div> <footer id="footer" class="mw-footer" > <ul id="footer-info"> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Wikisource:About">About Wikisource</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikisource:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/en.wikisource.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//en.m.wikisource.org/w/index.php?title=Module:TableTools&action=edit&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> <script>(RLQ=window.RLQ||[]).push(function(){mw.log.warn("This page is using the deprecated ResourceLoader module \"codex-search-styles\".\n[1.43] Use a CodexModule with codexComponents to set your specific components used: https://www.mediawiki.org/wiki/Codex#Using_a_limited_subset_of_components");mw.config.set({"wgHostname":"mw-web.codfw.canary-584f587977-z2x7p","wgBackendResponseTime":168,"wgPageParseReport":{"limitreport":{"cputime":"0.004","walltime":"0.012","ppvisitednodes":{"value":18,"limit":1000000},"postexpandincludesize":{"value":692,"limit":2097152},"templateargumentsize":{"value":0,"limit":2097152},"expansiondepth":{"value":2,"limit":100},"expensivefunctioncount":{"value":0,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":0,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 0.000 1 -total"]},"cachereport":{"origin":"mw-web.codfw.canary-584f587977-z2x7p","timestamp":"20241202221136","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>