+ Start a Discussion
ryanhcaryanhca 

Hiding HTML elements based on criteria -- without outputText

I have an HTML table that displays data, but it's not a dataTable. I would like to figure out a way to show or hide individual rows if the data for that row is missing (or some other criteria).

 

For something other than a table row, I would use a outputText tag with a rendered attribute that determines if the element will be shown. But an outputText tag puts a SPAN tag around the text inside the outputText tag, which isn't valid inside a table. 

 

Ideas? 

Best Answer chosen by Admin (Salesforce Developers) 
XactiumBenXactiumBen

Try using this:

 

<tr style="display: {!IF(myVariable == true, 'block', 'none')};">