Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Help:Table
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Row template === {{For|adding a dynamic row number as a table column|#Row numbers}} Regardless of whether wikitable format or HTML is used, the wikitext of the rows within a table, and sometimes even within a collection of tables, may have much in common, e.g.: * the basic code for a table row * code for color, alignment, and sorting mode * fixed texts such as units * special formats for sorting In such a case, it can be useful to create a template that produces the syntax for a table row, with the data as parameters. This can have many advantages: * easily changing the order of columns, or removing a column * easily adding a new column if many elements of the new column are left blank (if the column is inserted and the existing fields are unnamed, use a named parameter for the new field to avoid adding blank parameter values to many template calls) * computing fields from other fields, e.g. population density from population and area * duplicating content and providing span tags with <code>display: none;</code> for the purpose of having one format for [[Help:Sortable tables|sorting]] and another for display * easy specification of a format for a whole column, such as color and alignment Example: Using {{tlx|Help:Table/example row template}} <div class="box"> '''Wikitext''' <syntaxhighlight lang="wikitext" style="display: inline-block;"> {| class="wikitable sortable" |- ! scope=col | a ! scope=col | b ! scope=col | a/b {{Help:Table/example row template| 50|200}} {{Help:Table/example row template| 8| 11}} {{Help:Table/example row template|1000| 81}} |} </syntaxhighlight></div> <div class="box"> '''Produces''' {| class="wikitable sortable" |- ! scope=col | a ! scope=col | b ! scope=col | a/b {{Help:Table/example row template| 50|200}} {{Help:Table/example row template| 8| 11}} {{Help:Table/example row template|1000| 81}} |} </div>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)