Template:Table row unless/doc
Documentation
This template either outputs the code for a table row or doesn't, based on a specified condition. If the condition evaluates to the boolean value "true", nothing is output, otherwise a 2-column table row is output, with a header cell ("label") in the left column and a data cell ("content") in the right column, as seen in the example below. (Thus, this template is "the opposite of" {{table row if}}.)
Note that the template outputs HTML-style table code, not wiki-style. This is because the former tends to be a little more "robust" [i.e., less error-prone] than the latter.
Also note that the template is not intended to be used for general-purpose, arbitrary table rows. Its main purpose is to facilitate the creation of infobox templates.
Usage
{{table row unless|condition|label|content}}
If condition evaluates to a "true" boolean value (i.e., if it contains any non-whitespace characters), then don't output anything. Otherwise, output a table row based on the given label and content.
This is most useful when used in concert with {{table row if}} in cases where a simple "if-then-else" construct is not convenient. For example, you may want to show something at one point in an infobox if it exists, and then farther down, after other intervening rows, show something different if the original thing was not shown.
Example
<table class="wikitable">
{{table row unless|something|label 1|content 1}}
{{table row unless||label 2|content 2}}
{{table row unless| |label 3|content 3}}
</table>
⇓
| label 2 | content 2 |
|---|---|
| label 3 | content 3 |
As illustrated by the last template call in this example (the one with "content 3"), if the first unnamed/positional parameter consists only of whitespace (in this case, a space character, but it could also be a newline or a combination of spaces and newlines), then it evaluates to "false" and the table row gets displayed.