function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Salesforce BeginnerSalesforce Beginner 

Splitting Apex column to two sub columns

Hello Guys,

I am trying to split Apex column into two sub columns. How do we do this in VisualForce.

I am using the below code :
    <apex:pageBlockTable border="true" align="center" value="{!lstwrapper}" var="x" >  
           
           <apex:column headerValue="Admin Ticket" style="text-align:center" colspan="2">
               
            </apex:column>

             <apex:column headerValue="Answer Sheet" style="text-align:center"  colspan="2">
               
            </apex:column> 
            <apex:column headerValue="Exam Book" style="text-align:center"  colspan="2">
               
            </apex:column>
   
        </apex:pageBlockTable>




I need two sub columns under 3 main columns.
Ex:        Admin Ticket
               AM     PM

 
Best Answer chosen by Salesforce Beginner
shashi lad 4shashi lad 4
<apex:column> can not be by itself and will repeat for each record. Moreover you can nest this tag since it has to be a direct child of repeat tags. Easiest solution will be to use HTML.
 

<apex:repeat value="{!lstwrapper}" var="x" >  
<table>
  <tr >
    <th colspan="2">Admin Ticket</th>
  </tr>
  <tr>
    <th>AM</th>
    <th>pm</th>
  </tr>

</table>
</repeat>


thanks
shashi

All Answers

shashi lad 4shashi lad 4
<apex:column> can not be by itself and will repeat for each record. Moreover you can nest this tag since it has to be a direct child of repeat tags. Easiest solution will be to use HTML.
 

<apex:repeat value="{!lstwrapper}" var="x" >  
<table>
  <tr >
    <th colspan="2">Admin Ticket</th>
  </tr>
  <tr>
    <th>AM</th>
    <th>pm</th>
  </tr>

</table>
</repeat>


thanks
shashi
This was selected as the best answer
Salesforce BeginnerSalesforce Beginner
Thanks for the help Shashi. It did help. Used the repeat tag and was able to present the data in a table the way I wanted. However, I got a problem when I had more than 1000 rows.

" Collection size 1,066 exceeds maximum size of 1,000. " 

Did not understand the error as the List / Map can hold 10000 items (my understanding).