Hiding rows in table with empty parameter

Jump to: navigation, search

Hello,

i have a question about tables.

Let say that I will make a table, with several parameters by using template. For example:

Template:Parameter
{| style="border-collapse:collapse; border:solid #aaa 1px; margin:12px; font-size:90%; width:27em; padding:0.1em; text-align:left; float:right; clear:right;"
|-valign="top"
! Parameter1 :
|width="55%"| {{{Parameter1}}}

|-valign="top"
! Parameter2:
|width="55%"| {{{Parameter2}}}
|}

And on the other page, i will add posibility to fill them:

{{Template:Parameter
|parameter1=atribute1
|parameter2=atribute2
}}

If i dont add anything to "parameter2" it will show as empty box in table. Is posible, to remove or hide this entire row, if i dont fill "parameter2", so only parameters with atributes will show?

Thanks

Michals12322:37, 22 January 2012

Use ParserFunctions

{{#if:{{{Parameter1|}}}
 |yes
 |no
}}

Replace "|" in tables with "|" in a template {{!}}.

Subfader10:23, 23 January 2012
 

See for example Template:Features team notes box which does this also. It shows a "Date"-row if {{{date|}}} is given, and otherwise uses "Week" and perhaps "Time" instead.

Krinkle00:53, 24 January 2012

thanks a lot its working.

Michals12315:12, 24 January 2012
 
 
Personal tools

Variants
Actions
Navigation
Support
Download
Development
Communication
Toolbox