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
Shilpa Goyal 9Shilpa Goyal 9 

how can we place lable and input text in same row?

Hello everyone
I have
<tr><td><div><span>name:&nbsp<apex:inputtext/>
i want to put a lable (name)and input text in same row in this section</span></div></td></tr>.
but result is in 2 rows.
any help is appreciated.
Thanks
PriyaPriya (Salesforce Developers) 

Hey Shilpa,

I tried your code in my visualforce page. For me it is comming in same row like 
Name: INPUT TEXTFIELD BOX 

The code seems to be correct. Can you provide the screenshot of your result.

Thanks & Regards,

Priya Ranjan

Shilpa Goyal 9Shilpa Goyal 9
Yes Priya here is the result

User-added image

and code is

 
<tr style="height:1px;">
                                                 <td><span style="float:left;width:100%;margin-top:5px;font-size:18px">To get <b>Individual Contributor Assessment</b> form, 
                                                                                         please type your, name select your <b style="color:Green">Role</b>
                                                                                         and click "View Self Assessment"</span>
                                                 <div class="requiredInput">
                                                    
                                                     <span style="float:left;font-size:16px;font-weight:bold;">Name:&nbsp;
                                                     <apex:inputText id="name" value="{!usernm}"/></span>&nbsp;<br/>
                                                     <span style="float:left;font-size:16px;color:Green;font-weight:bold;">Role:&nbsp;
                                                     <apex:inputField value="{!Skill_Matrix__c.Role__c}" id="selfRole" onchange="callRole(this);"/>
                                                     <apex:actionFunction name="actfun2" action="{!selfAssessment}"/>
                                                     <button class="button" type="submit" name="View Self Assessment" onClick="return actfun2()" style="width:200px;height:20px;margin-left:100px">View Self Assessment
                                                            
                                                         </button>
                                                     
                                                         <!--<apex:commandButton value="View Self Assessment" />-->
                                                     </span>
                                                 </div>
                                                 
                                                 </td>
                                                
                                                 
                                             </tr>
PriyaPriya (Salesforce Developers) 
can you replace this line 
<span style="float:left;font-size:16px;font-weight:bold;">Name:&nbsp;
                                                     <apex:inputText id="name" value="{!usernm}"/></span>&nbsp;<br/>

with this
<span>Name:&nbsp;
                                                     <apex:inputText id="name" value="{!usernm}"/></span>&nbsp;<br/>

and check if it is coming in same line.
Shilpa Goyal 9Shilpa Goyal 9
No priya it doesn't workUser-added image
PriyaPriya (Salesforce Developers) 
one more thing we can do it using the pageblock tag like below :- 
<apex:pageBlock>
<apex:pageBlockSection columns="3">
               Name: <apex:inputField value="........"../>
            </apex:pageBlockSection>
</apex:pageBlock>

If this work, kindly mark it as the best answer.
Shilpa Goyal 9Shilpa Goyal 9
thank you priya, but i can't use another page block because i have evrything in one page block
 
PriyaPriya (Salesforce Developers) 
Within the same pageblock, can you another pageblockSelection and use my code given above and check. 
Shilpa Goyal 9Shilpa Goyal 9
Hi Priya, Thanks for responding. I found another solution and it worked.