Question

i have a VF page code

            <apex:pageBlockSection collapsible="false"  columns="2" >

                <apex:inputField value="{!Opp.field1__c}"/> 
                <apex:inputField value="{!Opp.field2__c}"/> 
                <apex:outputField value="{!Opp.field3__c}"/>    
                <apex:outputField value="{!Opp.field4__c}"/>    
        </apex:pageBlockSection>

I want to have a command button inside the blockSection. Can we have something like a colspan on table to merge the first line to a single column to hold the command button?

Thanks Prady

Was it helpful?

Solution

pageBlockSection renders as a table inside a div, so once you are "inside" you can just piggyback on that schema (at least until they change how they render sections). You need two columns per section column (in your case 2x2=>4). Use the following

<apex:pageBlockSection collapsible="false"  columns="2" >
   <tr>
      <td colspan="4">
         <apex:commandButton ...>
      </td>
   </tr>
   <apex:inputField value="{!Opp.field1__c}"/> 
   <apex:inputField value="{!Opp.field2__c}"/> 
   <apex:outputField value="{!Opp.field3__c}"/>    
   <apex:outputField value="{!Opp.field4__c}"/>    
</apex:pageBlockSection>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top