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

Template:Center

  • Template
  • Talk
  • Language
  • Watch
  • View source
Template documentationviewedithistorypurge
WarningThis template is used on approximately 299,000 pages.
To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them.

Description

It is to center elements on a page. See also Template:Align for more options and flexibility.

Usage

See also: Span and div
MarkupRenders as
{{Center|Hello world!}}
Hello world!

To do this without a template, simply use the following code:

<div class="center">...</div>

To center a table, see Help:TABLECENTER.

Notes:

  • If the markup to be centered includes an equals sign, the markup must be preceded by 1=. Example: {{Center|1=the <span style="color:red">red</span> one}}.
  • If the markup to be centered includes a displaying pipe, the pipe must be escaped as {{!}} or &#124;.

Tables

Using {{left}} / {{center}} / {{right}}

Header text
Left
Center
Right

Using {{align|left}} / {{align|center}} / {{align|right}}

Header text
Left
Center
Right

Tracking categories

  • Category:Pages using center with no arguments (23)
  • Category:Pages using center with unknown parameters (547)

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Center in articles based on its TemplateData.

TemplateData for Center

A simple template to center-align content in tables and other places. Be aware that the center class is applied to this template, which means every element within the template has its left and right margins set to auto. This may harm some templates.

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
Content1

Content to be centered

Contentrequired
Custom CSSstyle

Optional css styling for the centered text

Stringoptional

See also

  • {{Center block}}
  • {{align}}
  • {{right}}, {{left}} and {{justify}}
  • {{Image frame}}
  • {{Table alignment}} - to align whole columns in tables.
The above documentation is transcluded from Template:Center/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Center&oldid=1282577637"
Last edited on 27 March 2025, at 08:18

Languages

    • Аԥсшәа
    • Acèh
    • Afrikaans
    • Alemannisch
    • አማርኛ
    • Aragonés
    • Ænglisc
    • अंगिका
    • العربية
    • الدارجة
    • مصرى
    • অসমীয়া
    • Asturianu
    • Авар
    • Kotava
    • अवधी
    • Aymar aru
    • Azərbaycanca
    • تۆرکجه
    • Башҡортса
    • Basa Bali
    • Boarisch
    • Batak Toba
    • Bikol Central
    • Беларуская (тарашкевіца)
    • Беларуская
    • Български
    • भोजपुरी
    • ပအိုဝ်ႏဘာႏသာႏ
    • বাংলা
    • བོད་ཡིག
    • বিষ্ণুপ্রিয়া মণিপুরী
    • Bosanski
    • Буряад
    • Català
    • Chavacano de Zamboanga
    • 閩東語 / Mìng-dĕ̤ng-ngṳ̄
    • Нохчийн
    • Cebuano
    • ᏣᎳᎩ
    • کوردی
    • Corsu
    • Qırımtatarca
    • Čeština
    • Чӑвашла
    • Cymraeg
    • Dansk
    • Deutsch
    • Zazaki
    • डोटेली
    • Ελληνικά
    • Emiliàn e rumagnòl
    • Esperanto
    • Español
    • Eesti
    • Euskara
    • فارسی
    • Suomi
    • Føroyskt
    • Français
    • Arpetan
    • Frysk
    • Gaeilge
    • Galego
    • گیلکی
    • गोंयची कोंकणी / Gõychi Konknni
    • Bahasa Hulontalo
    • ગુજરાતી
    • Farefare
    • Hausa
    • 客家語 / Hak-kâ-ngî
    • עברית
    • हिन्दी
    • Hrvatski
    • Kreyòl ayisyen
    • Magyar
    • Հայերեն
    • Interlingua
    • Jaku Iban
    • Bahasa Indonesia
    • Igbo
    • Ilokano
    • ГӀалгӀай
    • Ido
    • Íslenska
    • Italiano
    • 日本語
    • Jawa
    • ქართული
    • Qaraqalpaqsha
    • Taqbaylit
    • Tyap
    • Kumoring
    • Қазақша
    • ភាសាខ្មែរ
    • ಕನ್ನಡ
    • 한국어
    • کٲشُر
    • Kurdî
    • Кыргызча
    • Latina
    • Lëtzebuergesch
    • Ladin
    • ລາວ
    • Lietuvių
    • Latviešu
    • मैथिली
    • Мокшень
    • Malagasy
    • Олык марий
    • Māori
    • മലയാളം
    • Монгол
    • ဘာသာမန်
    • मराठी
    • Кырык мары
    • Bahasa Melayu
    • Mirandés
    • မြန်မာဘာသာ
    • Эрзянь
    • مازِرونی
    • Napulitano
    • Nedersaksies
    • नेपाली
    • नेपाल भाषा
    • Nederlands
    • Norsk nynorsk
    • Norsk bokmål
    • Chi-Chewa
    • Occitan
    • Livvinkarjala
    • ଓଡ଼ିଆ
    • Ирон
    • ਪੰਜਾਬੀ
    • Pangasinan
    • Papiamentu
    • Picard
    • پښتو
    • Português
    • ရခိုင်
    • Ikirundi
    • Română
    • Руски
    • Русский
    • Русиньскый
    • Ikinyarwanda
    • संस्कृतम्
    • Scots
    • سنڌي
    • Srpskohrvatski / српскохрватски
    • Taclḥit
    • တႆး
    • සිංහල
    • Simple English
    • Slovenščina
    • Anarâškielâ
    • Shqip
    • Српски / srpski
    • SiSwati
    • Seeltersk
    • Svenska
    • Sakizaya
    • தமிழ்
    • ತುಳು
    • ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ
    • తెలుగు
    • Тоҷикӣ
    • ไทย
    • Türkmençe
    • Tagalog
    • Setswana
    • Tok Pisin
    • Türkçe
    • Xitsonga
    • Татарча / tatarça
    • ChiTumbuka
    • Twi
    • Тыва дыл
    • Українська
    • اردو
    • Oʻzbekcha / ўзбекча
    • Vèneto
    • Tiếng Việt
    • West-Vlams
    • Volapük
    • Winaray
    • 吴语
    • Хальмг
    • IsiXhosa
    • ייִדיש
    • Yorùbá
    • ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
    • 文言
    • 閩南語 / Bân-lâm-gí
    • 粵語
    • 中文
    • IsiZulu
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 27 March 2025, at 08:18 (UTC).
    • Page was rendered with Parsoid.
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Legal & safety contacts
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop view