+ Start a Discussion
TwEEkTwEEk 

CommandButton spacing

In a PageBlockSectionItem, I have two buttons:

<apex:pageBlockSection columns="1">

<apex:pageBlockSectionItem>

<apex:commandButton action="{!Submit}" value="Search" />

<apex:commandButton action="{!Submit}" value="Reset" />

</apex:pageBlockSectionItem>

</apex:pageBlockSection>

 

However the two buttons are spaced far appart and are not close side by side.


Putting them inside a "PageBlockButtons" tags will make this happen, however due to the required location of the buttons this is not an option.
 
Does anybody know how these two buttons can be pushed together?
 
 
Message Edited by TwEEk on 12-06-2009 03:46 PM
Message Edited by TwEEk on 12-06-2009 03:47 PM
Best Answer chosen by Admin (Salesforce Developers) 
prageethprageeth

Hello Tweek;

You may use styles to do this as below. Changes are marked in color.

 

<apex:pageBlockSection columns="1">

<apex:pageBlockSectionItem>

<apex:commandButton action="{!Submit}" style="left:0px;position:relative;" value="Search" />

<apex:commandButton action="{!Submit}" style="left:-20px;position:relative;" value="Reset" />

</apex:pageBlockSectionItem>

</apex:pageBlockSection>