Difference between revisions of "Template:Center"
From LIMSWiki
Jump to navigationJump to searchShawndouglas (talk | contribs) (Updated.) |
Shawndouglas (talk | contribs) m (Protected "Template:Center" ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><div class="center" style="width:auto; margin-left:auto; margin-right:auto;">{{{1}}}</div></includeonly><noinclude> | |||
{{documentation}} | |||
< | </noinclude> | ||
</ |
Latest revision as of 00:13, 31 May 2013
[edit] [ ] Template documentation
A simple template to center-align content in tables and other places.
Example
Markup | Renders as |
---|---|
{{Center|Hello world!}} |
Hello world!
|
To do this without a template, simply use the following code:
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">...</div>
Centering tables
Centered tables can be achieved, but they don't "float"; that is to say no text appears to either side. The trick is {| style="margin: 1em auto 1em auto;"
Wiki markup:
Text before table... {| class="wikitable" style="margin: 1em auto 1em auto;" |+ '''Cells left-aligned, table centered''' ! scope="col" | Duis ! scope="col" | aute ! scope="col" | irure |- | dolor || in reprehenderit || in voluptate velit |- | esse cillum dolore || eu fugiat nulla || pariatur. |} ...text after table
As it appears in a browser:
Text before table...
Duis | aute | irure |
---|---|---|
dolor | in reprehenderit | in voluptate velit |
esse cillum dolore | eu fugiat nulla | pariatur. |
...text after table
Table
Header text | ||
---|---|---|
Left2 |
Center |
Right
|
See also
- {{Startcenter}}
- {{Endcenter}}
- {{Left}}
- {{Left2}}
- {{Right}}
The above documentation is transcluded from Template:Center/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |