Salesforce | Dynamic table column headings in a VisualForce page

Author - Navdeep Kaur
22.05.2017
|
0 Comments
|

In VisualForce Page I wanted to have different column headings, like this:
1
I tried it using tag and tag but you can not display header value using tag as well as <apex:facetname=”header” > tag.

<apex:repeat value="{!prolist}" var="ls" >

<apex:column headerValue="Producer Commission"> 

<apex:outputText  value="{!ls}"/>

     </apex:column>
   </apex:repeat>

or<apex:repeat value="{!prolist}" var="ls" >

 
<apex:column> 

  <apex:facetname="header">Producer Commission</apex:facet>  

    <apex:outputText value="{!ls}"/>

   </apex:column>
  </apex:repeat>

Solution: You need to use html <table> tag to create table in this case.

<table border="1" id="t01" >
<thead>

<tr>

<apex:repeat value="{!prolist}" var="ls" >

<th>

Producer

</th>

</apex:repeat>

</tr>

</thead>
<tr>
<apex:repeat value="{!prolist}" var="ls" >

<td>
<apex:outputText value="{!ls}"/>
</td>
</apex:repeat>
</tr>
</table>


Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *