Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Vrienden Universe
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Center/doc
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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!
{{Documentation subpage}} <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> {{high use}} == Description == It is to center elements on a page. See also [[Template:Align]] for more options and flexibility. == Usage == {{See also|Span and div}} {{markup | <nowiki>{{Center|Hello world!}}</nowiki> | {{Center|Hello world!}} }} To do this without a template, simply use the following code: <syntaxhighlight lang="HTML"> <div class="center">...</div> </syntaxhighlight> To center a table, see [[Help:TABLECENTER]]. Notes: * If the markup to be centered includes an equals sign, the markup must be preceded by <code>1=</code>. Example: <code><nowiki>{{Center|1=the <span style="color:red">red</span> one}}</nowiki></code>. * If the markup to be centered includes a displaying pipe, the pipe must be escaped as <code><nowiki>{{!}}</nowiki></code> or <code>&#124;</code>. === Tables === Using {{tlc|left}} / {{tlc|center}} / {{tlc|right}} {| class="wikitable" !colspan="3" style="width:300px"| Header text |- | {{Left|Left}} || {{Center|Center}} || {{Right|Right}} |} Using {{tlc|align|left}} / {{tlc|align|center}} / {{tlc|align|right}} {| class="wikitable" !colspan="3" style="width:300px"| Header text |- | {{align|left|Left}} || {{align|center|Center}} || {{align|right|Right}} |} == Tracking categories == *{{clc|Pages using center with no arguments}} *{{clc|Pages using center with unknown parameters}} == TemplateData == {{TemplateDataHeader}} <templatedata> { "params": { "1": { "label": "Content", "type": "content", "required": true, "description": "Content to be centered" }, "style": { "label": "Custom CSS", "description": "Optional css styling for the centered text", "type": "string" } }, "description": "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." } </templatedata> == See also == * {{tl|Center block}} * {{tl|align}} * {{tl|right}}, {{tl|left}} and {{tl|justify}} * {{tl|Image frame}} * {{tl|Table alignment}} - to align whole columns in tables. <includeonly>{{sandbox other|| <!-- Categories below this line; interwikis at Wikidata --> [[Category:Positioning templates]] [[Category:Typing-aid templates]] [[Category:Wikipedia HTML tag-replacing templates]] }}</includeonly>
Summary:
Please note that all contributions to Vrienden Universe may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Vrienden Universe:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Pages included on this page:
Template:!!
(
edit
)
Template:!-
(
edit
)
Template:Align
(
edit
)
Template:Category link with count
(
edit
)
Template:Center
(
edit
)
Template:Clc
(
edit
)
Template:Documentation subpage
(
edit
)
Template:For loop
(
edit
)
Template:Format item
(
edit
)
Template:High-use
(
edit
)
Template:High use
(
edit
)
Template:Item
(
edit
)
Template:Left
(
edit
)
Template:Markup
(
edit
)
Template:Markup/row
(
edit
)
Template:Markup/styles.css
(
edit
)
Template:Mbox
(
edit
)
Template:Right
(
edit
)
Template:Sandbox other
(
edit
)
Template:See also
(
edit
)
Template:Strong
(
edit
)
Template:TemplateDataHeader
(
edit
)
Template:TemplateData header
(
edit
)
Template:Template link
(
edit
)
Template:Template link code
(
edit
)
Template:Template other
(
edit
)
Template:Template parameter usage
(
edit
)
Template:Terminate sentence
(
edit
)
Template:Tl
(
edit
)
Template:Tlc
(
edit
)
Template:Yesno
(
edit
)
Template:Yesno-no
(
edit
)
Module:Arguments
(
edit
)
Module:Check for unknown parameters
(
edit
)
Module:For loop
(
edit
)
Module:Format link
(
edit
)
Module:Hatnote
(
edit
)
Module:Hatnote list
(
edit
)
Module:High-use
(
edit
)
Module:Item
(
edit
)
Module:Labelled list hatnote
(
edit
)
Module:Message box
(
edit
)
Module:Message box/configuration
(
edit
)
Module:Message box/ombox.css
(
edit
)
Module:String
(
edit
)
Module:Template link general
(
edit
)
Module:Text
(
edit
)
Module:Text/data
(
edit
)
Module:Transclusion count
(
edit
)
Module:Transclusion count/data/C
(
edit
)
Module:Yesno
(
edit
)
This page is a member of 2 hidden categories:
Category:Pages with script errors
Category:Pages with broken file links
Search
Search
Editing
Template:Center/doc
Add topic