[SalesForce] Visualforce Styling – How to put command button after inputfield

I have a quick question regarding vf page styling. I have a page that looks like this

enter image description here

Basically, what I want to do is get the button "find study" to be on the right side of the field. My vf code looks like

<!-- Fields -->
        <apex:pageBlockSection collapsible="false" columns="2" id="pbsInfo" >
            <!-- Row 1 -->

            <apex:inputText value="{!query}" label="Protocol Number" id="inputField" >
            <apex:commandButton value="Find Study" action="{!runSearch}" reRender="pbsInfo" status="filterChangeStatus" />  
                <apex:actionStatus id="filterChangeStatus">
                        <apex:facet name="start">
                            <apex:image value="/img/loading.gif"/>
                        </apex:facet>
                </apex:actionStatus>
            </apex:inputText>

I've tried using html tags like div and span, but haven't been able to get it to work. Without creating a 3rd column, does anyone know how to solve this issue?

Best Answer

I got the answer after playing around with it for a while. Just added style="float:left" to the input text field

<apex:inputText value="{!query}" label="Protocol Number" id="inputField" style="float:left">
        <apex:commandButton value="Find Study" action="{!runSearch}" reRender="pbsInfo" status="filterChangeStatus" />  
            <apex:actionStatus id="filterChangeStatus">
                    <apex:facet name="start">
                        <apex:image value="/img/loading.gif"/>
                    </apex:facet>
            </apex:actionStatus>
        </apex:inputText>
Related Topic