HRWiki:autocolumn: Difference between revisions
imported>HRWikiMirrorBot Reimported from hrwiki.org Wayback HTML→wikitext (full reconvert) |
imported>HRWikiMirrorBot Reimported from hrwiki.org Wayback HTML→wikitext (full reconvert) |
||
| Line 1: | Line 1: | ||
<!-- | <!-- Wayback HTML body (hrwiki.org); RawHtml --> | ||
<html> | |||
<p><b>Description:</b> An extension to easily create tables whose columns have equal lengths (or nearly so), especially for tables that are updated often. | |||
</p><p><b>Filename:</b> exfAutoColumn.php | |||
</p><p><b>Written by:</b> <a href="/index.php?title=User:It%27s_dot_com" title="User:It's dot com">It's dot com</a> ©2006 | |||
</p><p><i>Please put any bugs or feature requests on the talk page.</i> | |||
</p> | |||
<a id="Format" name="Format"></a><h2> <span class="mw-headline">Format</span></h2> | |||
<pre><table [parameters]> | |||
<autocolumn [parameters]> | |||
[single list of content to be automatically divided] | [single list of content to be automatically divided] | ||
</autocolumn> | |||
</table></pre> | |||
<a id="Parameters" name="Parameters"></a><h2> <span class="mw-headline">Parameters</span></h2> | |||
== Parameters = | <p>The parameters in the <code><table></code> tag are the normal table parameters, and are optional. | ||
</p><p>The available <code><autocolumn></code> parameters are listed below. Each one is optional. | |||
The parameters in the <table> tag are the normal table parameters, and are optional. | </p> | ||
<dl><dd><code>cols</code> – the number of columns (the default is 2) | |||
The available <autocolumn> parameters are listed below. Each one is optional. | </dd><dd><code>width</code> – the remaining parameters are normal cell parameters | ||
</dd><dd><code>align</code> | |||
cols – the number of columns (the default is 2) | </dd><dd><code>valign</code> – "top" is the default value | ||
width – the remaining parameters are normal cell parameters | </dd><dd><code>class</code> | ||
align | </dd><dd><code>style</code> | ||
valign – "top" is the default value | </dd></dl> | ||
class | <p>You cannot have fewer than 2 columns (unless there is only 1 item in the list), nor can you have more columns than total items in the list. The function removes all extra white space between the tags and then formats each column according to standard wiki markup rules. | ||
style | </p> | ||
<a id="Known_limitations" name="Known_limitations"></a><h2> <span class="mw-headline">Known limitations</span></h2> | |||
You cannot have fewer than 2 columns (unless there is only 1 item in the list), nor can you have more columns than total items in the list. The function removes all extra white space between the tags and then formats each column according to standard wiki markup rules. | <ul><li>Automatic text replacement (for example, when signing using tildes (~~~~)) is not supported. This feature will be included when we upgrade to MediaWiki 1.6. | ||
</li></ul> | |||
== Known limitations | <a id="Variations" name="Variations"></a><h2> <span class="mw-headline">Variations</span></h2> | ||
<ul><li>You can use wiki table markup ( <code>{| ... |}</code> ) instead of HTML <i>(see gallery sample 1)</i>. | |||
</li><li>You can have a header row <i>(see gallery sample 1)</i>. | |||
</li><li>You can stack <code><autocolumn></code> rows within the same table <i>(see gallery sample 2)</i>. | |||
== Variations = | </li><li>If the <i>entire</i> list is an ordered list (each line begins with a <code>#</code> and has no subitems), it will be correctly numbered across the columns <i>(see gallery sample 3)</i>. | ||
</li></ul> | |||
<a id="Example" name="Example"></a><h2> <span class="mw-headline">Example</span></h2> | |||
<pre><table width="80%"> | |||
<autocolumn cols="3" width="33%"> | |||
== Example = | |||
<pre> | |||
*'''Debut:''' [[some kinda robot]] | *'''Debut:''' [[some kinda robot]] | ||
*[[i she be]] | *[[i she be]] | ||
| Line 59: | Line 51: | ||
*[[rock opera]] | *[[rock opera]] | ||
*[[technology]] | *[[technology]] | ||
</ | </autocolumn> | ||
</ | </table></pre> | ||
<table width="80%"> | |||
<tr><td valign="top" width="33%"> | |||
<ul><li><b>Debut:</b> <a href="/index.php?title=some_kinda_robot" title="some kinda robot">some kinda robot</a> | |||
</li><li><a href="/index.php?title=i_she_be" title="i she be">i she be</a> | |||
</li><li><a href="/index.php?title=guitar" title="guitar">guitar</a> | |||
</li><li><a href="/index.php?title=island" title="island">island</a> | |||
</li></ul> | |||
</td><td valign="top" width="33%"> | |||
== Gallery == | <ul><li><a href="/index.php?title=japanese_cartoon" title="japanese cartoon">japanese cartoon</a> | ||
</li><li><a href="/index.php?title=personal_favorites" title="personal favorites">personal favorites</a> | |||
View the source code to see how each table was made. You can also experiment in the | </li><li><a href="/index.php?title=different_town" title="different town">different town</a> | ||
</li></ul> | |||
=== Sample 1 === | </td><td valign="top" width="33%"> | ||
<ul><li><a href="/index.php?title=radio" title="radio">radio</a> | |||
</li><li><a href="/index.php?title=rock_opera" title="rock opera">rock opera</a> | |||
</li><li><a href="/index.php?title=technology" title="technology">technology</a> | |||
</li></ul> | |||
</td></tr> | |||
</table> | |||
<a id="Gallery" name="Gallery"></a><h2> <span class="mw-headline">Gallery</span></h2> | |||
<p>View the source code to see how each table was made. You can also experiment in the <a href="/index.php?title=HRWiki:Sandbox" title="HRWiki:Sandbox">sandbox</a>. | |||
</p> | |||
<a id="Sample_1" name="Sample_1"></a><h3> <span class="mw-headline">Sample 1</span></h3> | |||
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse"> | |||
<tr> | |||
< | <th colspan="5" style="background:#DDD"> Selected Toons | ||
</th></tr><tr><td valign="top"> | |||
=== | <ul><li><a href="/index.php?title=20X6_vs._1936" title="20X6 vs. 1936">20X6 vs. 1936</a> | ||
</li><li><a href="/index.php?title=500_The_Cheats" title="500 The Cheats">500 The Cheats</a> | |||
</li><li><a href="/index.php?title=A_Folky_Tale" title="A Folky Tale">A Folky Tale</a> | |||
</li><li><a href="/index.php?title=A_Jorb_Well_Done" title="A Jorb Well Done">A Jorb Well Done</a> | |||
</li><li><a href="/index.php?title=Arcade_Game" title="Arcade Game">Arcade Game</a> | |||
I<br /> | </li><li><a href="/index.php?title=Ballad_of_The_Sneak" title="Ballad of The Sneak">Ballad of The Sneak</a> | ||
drink<br /> | </li><li><a href="/index.php?title=Bug_In_Mouth_Disease" title="Bug In Mouth Disease">Bug In Mouth Disease</a> | ||
a<br /> | </li><li><a href="/index.php?title=Cheat_Commandos" title="Cheat Commandos">Cheat Commandos</a> | ||
tall<br /> | </li></ul> | ||
glass<br /> | </td><td valign="top"> | ||
<ul><li><a href="/index.php?title=Cheat_Commandos...O%27s" title="Cheat Commandos...O's">Cheat Commandos...O's</a> | |||
melonade<br /> | </li><li><a href="/index.php?title=Commandos_in_the_Classroom" title="Commandos in the Classroom">Commandos in the Classroom</a> | ||
I<br /> | </li><li><a href="/index.php?title=Cool_Things" title="Cool Things">Cool Things</a> | ||
like<br /> | </li><li><a href="/index.php?title=Experimental_Film" title="Experimental Film">Experimental Film</a> | ||
to<br /> | </li><li><a href="/index.php?title=Fluffy_Puff_Commercial" title="Fluffy Puff Commercial">Fluffy Puff Commercial</a> | ||
eat<br /> | </li><li><a href="/index.php?title=In_Search_of_the_Yello_Dello" title="In Search of the Yello Dello">In Search of the Yello Dello</a> | ||
</li><li><a href="/index.php?title=Kick_the_Can" title="Kick the Can">Kick the Can</a> | |||
147<br /> | </li><li><a href="/index.php?title=Lookin_at_a_Thing_in_a_Bag" title="Lookin at a Thing in a Bag">Lookin at a Thing in a Bag</a> | ||
Fluffy<br /> | </li></ul> | ||
Puff<br /> | </td><td valign="top"> | ||
Marshmallows<br /> | <ul><li><a href="/index.php?title=Meet_Marshie" title="Meet Marshie">Meet Marshie</a> | ||
</li><li><a href="/index.php?title=Mr._Shmallow" title="Mr. Shmallow">Mr. Shmallow</a> | |||
folks<br /> | </li><li><a href="/index.php?title=Parsnips_A-Plenty" title="Parsnips A-Plenty">Parsnips A-Plenty</a> | ||
they're<br /> | </li><li><a href="/index.php?title=Peasant%27s_Quest_Movie_Trailer" title="Peasant's Quest Movie Trailer">Peasant's Quest Movie Trailer</a> | ||
the<br /> | </li><li><a href="/index.php?title=Peasant%27s_Quest_Preview" title="Peasant's Quest Preview">Peasant's Quest Preview</a> | ||
</li><li><a href="/index.php?title=Senor_Mortgage" title="Senor Mortgage">Senor Mortgage</a> | |||
</li><li><a href="/index.php?title=Shopping_For_Danger" title="Shopping For Danger">Shopping For Danger</a> | |||
</li></ul> | |||
</td><td valign="top"> | |||
<ul><li><a href="/index.php?title=Sick_Day" title="Sick Day">Sick Day</a> | |||
</li><li><a href="/index.php?title=Strong_Bad_is_a_Bad_Guy" title="Strong Bad is a Bad Guy">Strong Bad is a Bad Guy</a> | |||
</li><li><a href="/index.php?title=Strong_Bad_is_in_Jail_Cartoon" title="Strong Bad is in Jail Cartoon">Strong Bad is in Jail Cartoon</a> | |||
</li><li><a href="/index.php?title=Strong_Bad_Sings" title="Strong Bad Sings">Strong Bad Sings</a> | |||
</li><li><a href="/index.php?title=The_Cheatar" title="The Cheatar">The Cheatar</a> | |||
</li><li><a href="/index.php?title=The_Interview" title="The Interview">The Interview</a> | |||
</li><li><a class="mw-redirect" href="/index.php?title=The_King_of_Town_DVD" title="The King of Town DVD">The King of Town DVD</a> | |||
</li></ul> | |||
</td><td valign="top"> | |||
<ul><li><a href="/index.php?title=The_Li%27l_Brudder_Show" title="The Li'l Brudder Show">The Li'l Brudder Show</a> | |||
</li><li><a href="/index.php?title=The_Luau" title="The Luau">The Luau</a> | |||
</li><li><a href="/index.php?title=The_Reddest_Radish" title="The Reddest Radish">The Reddest Radish</a> | |||
</li><li><a href="/index.php?title=The_System_is_Down" title="The System is Down">The System is Down</a> | |||
</li><li><a href="/index.php?title=Theme_Song_Video" title="Theme Song Video">Theme Song Video</a> | |||
</li><li><a href="/index.php?title=Trogdor_Con_%2797" title="Trogdor Con '97">Trogdor Con '97</a> | |||
</li><li><a href="/index.php?title=Where%27s_The_Cheat%3F" title="Where's The Cheat?">Where's The Cheat?</a> | |||
</li></ul> | |||
</td></tr> | |||
</table> | |||
<p><br/> | |||
</p> | |||
<a id="Sample_2" name="Sample_2"></a><h3> <span class="mw-headline">Sample 2</span></h3> | |||
<table cellspacing="5" style="background:gold; border:3px double black"> | |||
<tr><td align="center" style="background:lightyellow; border:1px solid black; padding:0.5em" valign="bottom"> | |||
<p>Before<br/> | |||
I<br/> | |||
drink<br/> | |||
a<br/> | |||
tall<br/> | |||
glass<br/> | |||
</p> | |||
</td><td align="center" style="background:lightyellow; border:1px solid black; padding:0.5em" valign="bottom"> | |||
<p>of<br/> | |||
melonade<br/> | |||
I<br/> | |||
like<br/> | |||
to<br/> | |||
eat<br/> | |||
</p> | |||
</td><td align="center" style="background:lightyellow; border:1px solid black; padding:0.5em" valign="bottom"> | |||
<p>about<br/> | |||
147<br/> | |||
Fluffy<br/> | |||
Puff<br/> | |||
Marshmallows<br/> | |||
</p> | |||
</td><td align="center" style="background:lightyellow; border:1px solid black; padding:0.5em" valign="bottom"> | |||
<p>Seriously<br/> | |||
folks<br/> | |||
they're<br/> | |||
the<br/> | |||
best | best | ||
</p> | |||
</td></tr> | |||
heard<br /> | <tr><td align="center" style="background:#EEF; border:1px solid black; padding:0.5em" valign="top"> | ||
<p>You<br/> | |||
folks<br /> | heard<br/> | ||
</p> | |||
likes<br /> | </td><td align="center" style="background:#EEF; border:1px solid black; padding:0.5em" valign="top"> | ||
<p>it<br/> | |||
folks<br/> | |||
</p> | |||
</td><td align="center" style="background:#EEF; border:1px solid black; padding:0.5em" valign="top"> | |||
<p>Homestar<br/> | |||
likes<br/> | |||
</p> | |||
</td><td align="center" style="background:#EEF; border:1px solid black; padding:0.5em" valign="top"> | |||
<p>marshmallows | |||
</p> | |||
</td></tr> | |||
</table> | |||
<p><br/> | |||
</p> | |||
<a id="Sample_3" name="Sample_3"></a><h3> <span class="mw-headline">Sample 3</span></h3> | |||
<table> | |||
<tr><td valign="top" width="200"> | |||
<ol start="1"><li><a href="/index.php?title=User:AbdiViklas" title="User:AbdiViklas">AbdiViklas</a> | |||
</li><li><a href="/index.php?title=User:Alcnolien" title="User:Alcnolien">Alcnolien</a> | |||
</li><li><a href="/index.php?title=User:Bad_Graphics_Ghost" title="User:Bad Graphics Ghost">Bad Graphics Ghost</a> | |||
</li><li><a href="/index.php?title=User:BazookaJoe" title="User:BazookaJoe">BazookaJoe</a> | |||
</li><li><a href="/index.php?title=User:Bill" title="User:Bill">Bill</a> | |||
</li><li><a class="mw-redirect" href="/index.php?title=User:Bluebry_muffin" title="User:Bluebry muffin">Bluebry muffin</a> | |||
</li><li><a href="/index.php?title=User:Chmera" title="User:Chmera">Chmera</a> | |||
</li><li><a href="/index.php?title=User:Csours" title="User:Csours">Csours</a> | |||
</li><li><a class="new" href="/index.php?title=User:DBK" title="User:DBK (page does not exist)">Dantheburgerking</a> | |||
</li><li><a href="/index.php?title=User:Darthvader66" title="User:Darthvader66">Darthvader66</a> | |||
</li><li><a href="/index.php?title=User:DorianGray" title="User:DorianGray">DorianGray</a> | |||
</li><li><a href="/index.php?title=User:Double_J" title="User:Double J">Double J</a> | |||
</li><li><a href="/index.php?title=User:FireBird" title="User:FireBird">FireBird</a> | |||
</li><li><a href="/index.php?title=User:Frickinsellout" title="User:Frickinsellout">Frickinsellout</a> | |||
</li><li><a href="/index.php?title=User:GWR_2004" title="User:GWR 2004">GWR 2004</a> | |||
</li></ol> | |||
</td><td valign="top" width="200"> | |||
<ol start="16"><li><a href="/index.php?title=User:Has_Matt%3F" title="User:Has Matt?">Has Matt?</a> | |||
</li><li><a href="/index.php?title=User:Heimstern_L%C3%A4ufer" title="User:Heimstern Läufer">Heimstern Läufer</a> | |||
</li><li><a href="/index.php?title=User:It%27s_dot_com" title="User:It's dot com">It's dot com</a> | |||
</li><li><a href="/index.php?title=User:ItalianBallerina" title="User:ItalianBallerina">ItalianBallerina</a> | |||
</li><li><a href="/index.php?title=User:Jay" title="User:Jay">Jay</a> | |||
</li><li><a href="/index.php?title=User:Jetamoo" title="User:Jetamoo">Jetamoo</a> | |||
</li><li><a href="/index.php?title=User:Joshua" title="User:Joshua">Joshua</a> | |||
</li><li><a href="/index.php?title=User:KieferSkunk" title="User:KieferSkunk">KieferSkunk</a> | |||
</li><li><a href="/index.php?title=User:Kilroy" title="User:Kilroy">Kilroy</a> | |||
</li><li><a href="/index.php?title=User:Lapper" title="User:Lapper">Lapper</a> | |||
</li><li><a href="/index.php?title=User:LePorello" title="User:LePorello">LePorello</a> | |||
</li><li><a href="/index.php?title=User:Mycroft.holmes" title="User:Mycroft.holmes">Mycroft Holmes</a> | |||
</li><li><a href="/index.php?title=User:NFITC1" title="User:NFITC1">NFITC1</a> | |||
</li><li><a href="/index.php?title=User:Nintendostar_Runner" title="User:Nintendostar Runner">Nintendostar Runner</a> | |||
</li><li><a href="/index.php?title=User:Octan" title="User:Octan">Octan</a> | |||
</li></ol> | |||
</td><td valign="top" width="200"> | |||
<ol start="31"><li><a href="/index.php?title=User:Qermaq" title="User:Qermaq">Qermaq</a> | |||
</li><li><a href="/index.php?title=User:Rogue_Leader" title="User:Rogue Leader">Rogue Leader</a> | |||
</li><li><a class="mw-redirect" href="/index.php?title=User:Sam_Goldfish" title="User:Sam Goldfish">Sam Goldfish</a> | |||
</li><li><a class="mw-redirect" href="/index.php?title=User:Seriously" title="User:Seriously">Seriously</a> | |||
</li><li><a href="/index.php?title=User:Shadow_Hog" title="User:Shadow Hog">Shadow Hog</a> | |||
</li><li><a href="/index.php?title=User:Spell4yr" title="User:Spell4yr">Spell4yr</a> | |||
</li><li><a href="/index.php?title=User:Teh_Frossty_One" title="User:Teh Frossty One">Teh Frossty One</a> | |||
</li><li><a href="/index.php?title=User:Thunderbird_L17" title="User:Thunderbird L17">Thunderbird L17</a> | |||
</li><li><a href="/index.php?title=User:Trelawney" title="User:Trelawney">Trelawney</a> | |||
</li><li><a href="/index.php?title=User:Trey56" title="User:Trey56">Trey56</a> | |||
</li><li><a href="/index.php?title=User:Venusy" title="User:Venusy">Venusy</a> | |||
</li><li><a href="/index.php?title=User:Xeroc" title="User:Xeroc">Xeroc</a> | |||
</li><li><a href="/index.php?title=User:YK" title="User:YK">YK</a> | |||
</li><li><a href="/index.php?title=User:Yourmomgoestocollege" title="User:Yourmomgoestocollege">Yourmomgoestocollege</a> | |||
</li></ol> | |||
</td></tr> | |||
</table> | |||
<div class="visualClear"></div> | |||
</html> | |||
Latest revision as of 21:00, 18 July 2026
Description: An extension to easily create tables whose columns have equal lengths (or nearly so), especially for tables that are updated often.
Filename: exfAutoColumn.php
Written by: It's dot com ©2006
Please put any bugs or feature requests on the talk page.
Format
<table [parameters]> <autocolumn [parameters]> [single list of content to be automatically divided] </autocolumn> </table>
Parameters
The parameters in the <table> tag are the normal table parameters, and are optional.
The available <autocolumn> parameters are listed below. Each one is optional.
cols– the number of columns (the default is 2)width– the remaining parameters are normal cell parametersalignvalign– "top" is the default valueclassstyle
You cannot have fewer than 2 columns (unless there is only 1 item in the list), nor can you have more columns than total items in the list. The function removes all extra white space between the tags and then formats each column according to standard wiki markup rules.
Known limitations
- Automatic text replacement (for example, when signing using tildes (~~~~)) is not supported. This feature will be included when we upgrade to MediaWiki 1.6.
Variations
- You can use wiki table markup (
{| ... |}) instead of HTML (see gallery sample 1). - You can have a header row (see gallery sample 1).
- You can stack
<autocolumn>rows within the same table (see gallery sample 2). - If the entire list is an ordered list (each line begins with a
#and has no subitems), it will be correctly numbered across the columns (see gallery sample 3).
Example
<table width="80%"> <autocolumn cols="3" width="33%"> *'''Debut:''' [[some kinda robot]] *[[i she be]] *[[guitar]] *[[island]] *[[japanese cartoon]] *[[personal favorites]] *[[different town]] *[[radio]] *[[rock opera]] *[[technology]] </autocolumn> </table>
|
Gallery
View the source code to see how each table was made. You can also experiment in the sandbox.
Sample 1
| Selected Toons | ||||
|---|---|---|---|---|
Sample 2
|
Before |
of |
about |
Seriously |
|
You |
it |
Homestar |
marshmallows |