how to display a table with dynamic columns in vf page

how to display a table with dynamic columns in vf page

<apex:pageBlock id="block">
    <apex:pageBlockTable id="table" var="exhlst" value="{!exhibitorList}">
    <tr>
        <td styleClass="freeze_horizontal">
        
        <b><apex:outputField value="{!exhlst.Name}" styleClass="freeze_horizontal"/></b>
        
        </td>
        <td>
            <apex:repeat value="{!$ObjectType.Exhibitor_Authenticity__c.FieldSets.NationalitiesName}" var="c">
              <apex:column headerValue="{!$ObjectType.Exhibitor_Authenticity__c.fields[c].Label}">
              <div style="background-color:{!If(exhlst[c]== 'Authentic','#b3ffb3',If(exhlst[c]== 'Remaining','#ffd480','#ff9999'))};">    
                    <apex:outputField value="{!exhlst[c]}"></apex:outputField>
               </div>
            </apex:column>
            </apex:repeat>
        </td>
    </tr>
   </apex:pageBlockTable>
</apex:pageBlock>

No comments:

Post a Comment