HRWiki:autocolumn

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
("top" is now the default valign value)
(+ another gallery sample)
Line 30: Line 30:
==Variations==
==Variations==
-
*You can use wiki table markup ( <code><nowiki>{| ... |}</nowiki></code> ) instead of HTML.
+
*You can use wiki table markup ( <code><nowiki>{| ... |}</nowiki></code> ) instead of HTML ''(see gallery sample 1)''.
-
*You can have a header row.
+
*You can have a header row ''(see gallery sample 1)''.
-
*You can stack <code><nowiki><autocolumn></nowiki></code> rows within the same table.
+
*You can stack <code><nowiki><autocolumn></nowiki></code> rows within the same table ''(see gallery sample 2)''.
 +
*If the ''entire'' list is an ordered list (each line begins with a <code>#</code> and has no subitems), it will be correctly numbered across the columns ''(see gallery sample 3)''.
==Example==
==Example==
Line 68: Line 69:
View the source code to see how each table was made. You can also experiment in the [[HRWiki:Sandbox|sandbox]].
View the source code to see how each table was made. You can also experiment in the [[HRWiki:Sandbox|sandbox]].
 +
===Sample 1===
{| border=1 cellspacing=0 cellpadding=5 style="border-collapse:collapse"
{| border=1 cellspacing=0 cellpadding=5 style="border-collapse:collapse"
|-
|-
Line 113: Line 115:
 +
===Sample 2===
<table style="background:gold; border:3px double black" cellspacing="5">
<table style="background:gold; border:3px double black" cellspacing="5">
<autocolumn cols="4" valign="bottom" align="center" style="background:lightyellow; border:1px solid black; padding:0.5em">
<autocolumn cols="4" valign="bottom" align="center" style="background:lightyellow; border:1px solid black; padding:0.5em">
Line 146: Line 149:
likes<br>
likes<br>
marshmallows
marshmallows
 +
</autocolumn>
 +
</table>
 +
 +
 +
===Sample 3===
 +
<table>
 +
<autocolumn cols="3" width="200">
 +
#[[User:AbdiViklas|AbdiViklas]]
 +
#[[User:Alcnolien|Alcnolien]]
 +
#[[User:Bad Graphics Ghost|Bad Graphics Ghost]]
 +
#[[User:BazookaJoe|BazookaJoe]]
 +
#[[User:Bill Martinson|Bill Martinson]]
 +
#[[User:Bluebry muffin|Bluebry muffin]]
 +
#[[User:Chmera|Chmera]]
 +
#[[User:Csours|Csours]]
 +
#[[User:Dantheburgerking|Dantheburgerking]]
 +
#[[User:Darthvader66|Darthvader66]]
 +
#[[User:DorianGray|DorianGray]]
 +
#[[User:Double J|Double J]]
 +
#[[User:FireBird|FireBird]]
 +
#[[User:Frickinsellout|Frickinsellout]]
 +
#[[User:GWR 2004|GWR 2004]]
 +
#[[User:Has Matt?|Has Matt?]]
 +
#[[User:Heimstern Läufer|Heimstern Läufer]]
 +
#[[User:It's dot com|It's dot com]]
 +
#[[User:ItalianBallerina|ItalianBallerina]]
 +
#[[User:Jay|Jay]]
 +
#[[User:Jetamoo|Jetamoo]]
 +
#[[User:Joshua|Joshua]]
 +
#[[User:KieferSkunk|KieferSkunk]]
 +
#[[User:Kilroy|Kilroy]]
 +
#[[User:Lapper|Lapper]]
 +
#[[User:LePorello|LePorello]]
 +
#[[User:Mycroft.holmes|Mycroft Holmes]]
 +
#[[User:NFITC1|NFITC1]]
 +
#[[User:Nintendostar Runner|Nintendostar Runner]]
 +
#[[User:Octan|Octan]]
 +
#[[User:Qermaq|Qermaq]]
 +
#[[User:Rogue Leader|Rogue Leader]]
 +
#[[User:Sam Goldfish|Sam Goldfish]]
 +
#[[User:Seriously|Seriously]]
 +
#[[User:Shadow Hog|Shadow Hog]]
 +
#[[User:Spell4yr|Spell4yr]]
 +
#[[User:Teh Frossty One|Teh Frossty One]]
 +
#[[User:Thunderbird L17|Thunderbird]]
 +
#[[User:Trelawney|Trelawney]]
 +
#[[User:Trey56|Trey56]]
 +
#[[User:Venusy|Venusy]]
 +
#[[User:Xeroc|Xeroc]]
 +
#[[User:YK|YK]]
 +
#[[User:Yourmomgoestocollege|Yourmomgoestocollege]]
</autocolumn>
</autocolumn>
</table>
</table>
[[Category:Help]]
[[Category:Help]]

Revision as of 21:07, 21 February 2006

Description: An extension to easily create tables whose columns have equal lengths (or nearly so), especially for tables that are updated often.

Filename: wfAutoColumn.php

Written by: It's dot com ©2006

Please put any bugs or feature requests on the talk page.

Contents

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 parameters
align
valign – "top" is the default value
class
style

You cannot have fewer than 2 columns, except that you cannot 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.

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
I
drink
a
tall
glass

of
melonade
I
like
to
eat

about
147
Fluffy
Puff
Marshmallows

Seriously
folks
they're
the
best

You
heard

it
folks

Homestar
likes

marshmallows


Sample 3

  1. AbdiViklas
  2. Alcnolien
  3. Bad Graphics Ghost
  4. BazookaJoe
  5. Bill Martinson
  6. Bluebry muffin
  7. Chmera
  8. Csours
  9. Dantheburgerking
  10. Darthvader66
  11. DorianGray
  12. Double J
  13. FireBird
  14. Frickinsellout
  15. GWR 2004
  1. Has Matt?
  2. Heimstern Läufer
  3. It's dot com
  4. ItalianBallerina
  5. Jay
  6. Jetamoo
  7. Joshua
  8. KieferSkunk
  9. Kilroy
  10. Lapper
  11. LePorello
  12. Mycroft Holmes
  13. NFITC1
  14. Nintendostar Runner
  15. Octan
  1. Qermaq
  2. Rogue Leader
  3. Sam Goldfish
  4. Seriously
  5. Shadow Hog
  6. Spell4yr
  7. Teh Frossty One
  8. Thunderbird
  9. Trelawney
  10. Trey56
  11. Venusy
  12. Xeroc
  13. YK
  14. Yourmomgoestocollege