Template:Escape template list/doc: Difference between revisions
ArrowHead294 (talk | contribs) m Documentation already exists on en-Wikipedia |
ArrowHead294 (talk | contribs) mNo edit summary |
||
Line 2: | Line 2: | ||
'''Note:''' You can use <code>{{((}}esctl{{))}}</code> as a shortcut. | '''Note:''' You can use <code>{{((}}esctl{{))}}</code> as a shortcut. | ||
== Usage == | |||
These templates are used to escape special character sequences (most notably table cell separators), so that they are interpreted later than they would otherwise be. They is most useful when trying to include tables in templates. | |||
For example, this table: | |||
{| class="wikitable" | |||
|+ style="font-size: 105%;" | Caption text | |||
|- | |||
! Header text !! colspan="2" | Header text !! Header text | |||
|- | |||
| Example 0 || Example 1 || Example 2 || Example 3 | |||
|- | |||
| Example 4 || Example 5 || Example 6 || Example 7 | |||
|- | |||
| Example 8 || Example 9 || Example 10 || Example 11 | |||
|} | |||
is generated using: | |||
<pre> | |||
{| class="wikitable" | |||
|+ style="font-size: 105%;" | Caption text | |||
|- | |||
! Header text !! colspan="2" | Header text !! Header text | |||
|- | |||
| Example 0 || Example 1 || Example 2 || Example 3 | |||
|- | |||
| Example 4 || Example 5 || Example 6 || Example 7 | |||
|- | |||
| Example 8 || Example 9 || Example 10 || Example 11 | |||
|} | |||
</pre> | |||
The below markup represents the same table, but with all of the special character sequences escaped: | |||
<pre> | |||
{{(!}} class{{=}}"wikitable" | |||
{{!+}} style{{=}}"font-size: 105%;" {{!}} Caption text | |||
{{!-}} | |||
! Header text !! colspan{{=}}"2" {{!}} Header text !! Header text | |||
{{!-}} | |||
{{!}} Example 0 {{!!}} Example 1 {{!!}} Example 2 {{!!}} Example 3 | |||
{{!-}} | |||
{{!}} Example 4 {{!!}} Example 5 {{!!}} Example 6 {{!!}} Example 7 | |||
{{!-}} | |||
{{!}} Example 8 {{!!}} Example 9 {{!!}} Example 10 {{!!}} Example 11 | |||
{{!)}} | |||
</pre> |