Difference between revisions of "Template:Center"

From RimWorld Wiki
Jump to navigation Jump to search
(Template blatantly copied from MediaWiki, with some inspiration from wikipedia proper. All because I wanted less convoluted formatting.)
 
m (I think the "_" in Category was stopping this page from properly appearing on the Category page (but it was still counted). Worse case, this will do nothing.)
 
Line 25: Line 25:
 
</div>
 
</div>
  
[[Category:Formatting_templates]]
+
[[Category:Formatting templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 15:28, 4 July 2024


Documentation icon Template documentation

This template is used to centralize the texts.

Usage

{{center|Insert text here.}}

produces:

Insert text here.

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

<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">YOUR TEXT HERE</div>

In the alternative, the following is also valid:

<div style="text-align: center;">YOUR TEXT HERE</div>

Do note that this template only works with text. It will work if applied to a image's caption, but not if applied to the image itself. It won't work on tables either. If either of the codes described above area applied to a table directly, then its contents will be centered but not the table itself.