• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:Wikitable

  • Template
  • Talk
  • Language
  • Watch
  • Edit
Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:Wikitable


Usage

edit

This template is designed to make passing tables to templates less of a hassle.

Oftentimes, adding wikitable markup to a template or other parser tag generates gibberish when one fails to escape every | and =. Moreover, escaping pipe characters with {{!}} everywhere can make for some rather ugly-looking markup.

With this module, most wikitables can be embedded into templates without escaping any pipe characters. Also, = for <table> element attributes do not need to be escaped, however, for individual rows and cells, such is still necessary. Finally, there must be at least one pipe character before the first header cell (only an issue if |- is omitted before the first row)

See Differences:

original (copied from: 2016 Summer Olympics):
2016 Summer Olympics bidding results[1]
City NOC Round 1 Round 2 Round 3
Rio de Janeiro  Brazil 26 46 66
Madrid  Spain 28 29 32
Tokyo  Japan 22 20 —
Chicago  United States 18 — —

code:

{| class="wikitable" width="auto" style="text-align: center"
|-
! colspan="6" |2016 Summer Olympics bidding results<ref>{{cite web |url=http://www.gamesbids.com/eng/past.html |title=Past Bid Results |publisher=GamesBids.com |access-date=31 October 2015 |url-status=dead |archive-url=https://www.webcitation.org/5xFvf0ufx?url=http://www.gamesbids.com/eng/past.html |archive-date=17 March 2011}}</ref>
[[File:Bids for the 2016 Summer Olympics.svg|center|500px]]
|- style="background:#efefef;"
! City
! NOC
| style="background: silver" |'''Round 1'''
| style="background: silver" |'''Round 2'''
| style="background: silver" |'''Round 3'''
|-
| style="text-align:left;" |'''[[Rio de Janeiro 2016 Olympic bid|Rio de Janeiro]]'''
| style="text-align:left;" |'''{{BRA}}'''
| style="text-align:center;" |26
| style="text-align:center;" |'''46'''
| style="text-align:center;" |'''66'''
|-
| style="text-align:left;" |[[Madrid bid for the 2016 Summer Olympics|Madrid]]
| style="text-align:left;" |{{ESP}}
| style="text-align:center;" |'''28'''
| style="text-align:center;" |29
| style="text-align:center;" |32
|-
| style="text-align:left;" |[[Tokyo bid for the 2016 Summer Olympics|Tokyo]]
| style="text-align:left;" |{{JPN}}
| style="text-align:center;" |22
| style="text-align:center;" |20
| style="text-align:center;" |—
|-
| style="text-align:left;" |[[Chicago bid for the 2016 Summer Olympics|Chicago]]
| style="text-align:left;" |{{USA}}
| style="text-align:center;" |18
| style="text-align:center;" |—
| style="text-align:center;" |—
|}
module:
2016 Summer Olympics bidding results[2]
City NOC Round 1 Round 2 Round 3
Rio de Janeiro  Brazil 26 46 66
Madrid  Spain 28 29 32
Tokyo  Japan 22 20 —
Chicago  United States 18 — —
code (with changes highlighted):
{{wikitable| class="wikitable" width="auto" style="text-align: center"
|-
! colspan{{=}}"6" |2016 Summer Olympics bidding results<ref>{{cite web |url=http://www.gamesbids.com/eng/past.html |title=Past Bid Results |publisher=GamesBids.com |access-date=31 October 2015 |url-status=dead |archive-url=http://www.webcitation.org/5xFvf0ufx?url=http://www.gamesbids.com/eng/past.html |archive-date=17 March 2011}}</ref>
[[Image:Bids for the 2016 Summer Olympics.svg|center|500px]]
|- style{{=}}"background:#efefef;"
! City
! NOC
| style{{=}}"background: silver" |'''Round 1'''
| style{{=}}"background: silver" |'''Round 2'''
| style{{=}}"background: silver" |'''Round 3'''
|-
| style{{=}}"text-align:left;" |'''[[Rio de Janeiro bid for the 2016 Summer Olympics|Rio de Janeiro]]'''
| style{{=}}"text-align:left;" |'''{{BRA}}'''
| style{{=}}"text-align:center;" |26
| style{{=}}"text-align:center;" |'''46'''
| style{{=}}"text-align:center;" |'''66'''
|-
| style{{=}}"text-align:left;" |[[Madrid bid for the 2016 Summer Olympics|Madrid]]
| style{{=}}"text-align:left;" |{{ESP}}
| style{{=}}"text-align:center;" |'''28'''
| style{{=}}"text-align:center;" |29
| style{{=}}"text-align:center;" |32
|-
| style{{=}}"text-align:left;" |[[Tokyo bid for the 2016 Summer Olympics|Tokyo]]
| style{{=}}"text-align:left;" |{{JPN}}
| style{{=}}"text-align:center;" |22
| style{{=}}"text-align:center;" |20
| style{{=}}"text-align:center;" |—
|-
| style{{=}}"text-align:left;" |[[Chicago bid for the 2016 Summer Olympics|Chicago]]
| style{{=}}"text-align:left;" |{{USA}}
| style{{=}}"text-align:center;" |18
| style{{=}}"text-align:center;" |—
| style{{=}}"text-align:center;" |—
}}

Sources cited in example

edit
  1. ^ "Past Bid Results". GamesBids.com. Archived from the original on 17 March 2011. Retrieved 31 October 2015.
  2. ^ "Past Bid Results". GamesBids.com. Archived from the original on 17 March 2011. Retrieved 31 October 2015.

See also

edit
  • {{Table}}
The above documentation is transcluded from Template:Wikitable/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Wikitable&oldid=980688369"
Last edited on 27 September 2020, at 21:54

Languages

    • বাংলা
    • Cebuano
    • ཇོང་ཁ
    • فارسی
    • 한국어
    • Madhurâ
    • Norsk bokmål
    • Oʻzbekcha / ўзбекча
    • ਪੰਜਾਬੀ
    • پښتو
    • සිංහල
    • Simple English
    • سنڌي
    • တႆး
    • ไทย
    • Türkçe
    • Українська
    • اردو
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 27 September 2020, at 21:54 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop