Sample Code:
<apex:outputPanel style=”visibility:{! IF(ISNULL(PGList), ‘hidden’, ‘visible’) }”>
<apex:outputText styleClass=”bld” value=”Public Group(s) :”/><br/>
<apex:pageBlockTable value=”{!PGList}” var=”PG”>
<apex:column value=”{!PG.Name}”/>
</apex:pageBlockTable>
</apex:outputPanel>
<apex:outputPanel style=”visibility:{! IF(ISNULL(PGList), ‘hidden’, ‘visible’) }”>
<apex:outputText styleClass=”bld” value=”Public Group(s) :”/><br/>
<apex:pageBlockTable value=”{!PGList}” var=”PG”>
<apex:column value=”{!PG.Name}”/>
</apex:pageBlockTable>
</apex:outputPanel>
here PGList is a list variable.