Can I write a multiline if statement in Apex/Visualforce HTML?
Something like (definitely pseudocode):
<apex if (condition)>
<strong>This HTML.</strong>
<apex else>
<strong>This is the false HTML.</strong>
<apex end>
Update
It seems like the answers here don't work, i.e. neither this:
<apex:outputPanel rendered="{!IF(Lead.Credit__c > 0)}">
<tr>
<td>Credit</td>
<td>{!Lead.Credit__c}</td>
</tr>
</apex:outputPanel>
Nor this work:
<apex:variable var="v" value="1" rendered="{!IF(Lead.Credit__c > 0)}">
<tr>
<td>Credit</td>
<td>{!Lead.Credit__c}</td>
</tr>
</apex:variable>
Does it have to be a boolean value?
Best Answer
Use like below
else
Addition to above
If you are using html elements and want to hide based on conditions