Template:Align

{{{1}}}
Documentation icon Template documentation[view] [edit] [history] [purge]

Usage

{{align}} aligns the output text (or other element) as centered, to the left, or to the right.

Parameters

There are 2 parameters, both unnamed, of which 1 is required and 1 is optional.

Syntax

The template's syntax is

  • {{align|custom text/element |alignment value }}

Required parameter

1

Custom text/element

The text (or other element) you wish to align. The parameter is unnamed, so no parameter name needs to be specified.

Note
  • This parameter must be placed before the 2nd parameter.
Usage
  • {{align|1}}

Optional parameter

2

Alignment

Specifies the alignment you want to impose on the text/element in parameter |1. The parameter is unnamed, so no parameter name needs to be specified.

Available values
Value Default
center
Green check.png
left
right
Notes
  • This parameter must be placed after the 1st parameter.
  • By default, this parameter will be set to the value center.
  • If a invalid value is entered, the template will display an error message.
Usage
  • {{align|1|2}}

Examples

Correct use

Element Alignment What you type What you see
Text Center {{align|This text is center-aligned}}
This text is center-aligned
{{align|This text is center-aligned|center}}
This text is center-aligned
Left {{align|This text is left-aligned|left}}
This text is left-aligned
Right {{align|This text is right-aligned|right}}
This text is right-aligned
Image Center {{align|[[File:Idea.png|20px|link=]]}}
Idea.png
{{align|[[File:Idea.png|20px|link=]]|center}}
Idea.png
Left {{align|[[File:Idea.png|20px|link=]]|left}}
Idea.png
Right {{align|[[File:Idea.png|20px|link=]]|right}}
Idea.png

Incorrect use

Alignment What you type What you see
Any other than
center,
left, or
right
{{align|This text will not be displayed|middle}} Error in {{align}}: the alignment value "middle" is invalid.

See also

Specific alignment