Template talk:!
Documentation
If you want to display a pipe as plain text without it being parsed by the wiki, just use |, which can be used in wiki tables and inside template variables without any problems.
If you need to put wiki table code into the variable of a template, you will need to replace your pipes with a call to this template like so {{!}}. This will prevent the wiki from thinking there are pipes separating one variable from another when you set up the template, but will become a "real" pipe when the template is called, meaning the wiki will then treat it as part of your table syntax. This is often used as a reult of selection templates such as {{if}}, {{ifdef}} and {{ifndef}}.
For example, here we use {{ifdef}} on two imaginary variables, the first is defined but the second is not. So only the first should appear in the table.
{| style="border:1px solid black" {{ifdef|x|2={{!}} style="color:red" {{!}} If you see me, the first variable is defined.}} |- {{ifdef||2={{!}} style="color:blue" {{!}} If you see me, the second variable is defined.}} |}
The result:
If you see me, the first variable is defined. |