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
ShikibuShikibu 

can't align elements within pageBlockSection

I'm building a form in VisualForce, and I can't get the elements of a pageBlockSection to line up. Here's my problem: the dropdown label is not in bold, it is not aligned horizontally with the dropdown, and neither label nor dropdown is aligned with the inputFields below it.

 

How can I get these to align? It seems I would have to group the label and dropdown somehow.

 

 

 

 

Here's my visualforce code:

 

 

<apex:pageBlockSection title="Account Information" columns="1">

<apex:outputLabel value="Record Type" for="AccountRT"/>
<apex:selectList id="AccountRT" value="{!theAccountRecordTypeID}">
<apex:selectOptions value="{!theAccountRecordTypeOptions}"/>
</apex:selectList>

<apex:inputField value="{!theAccount.name}"/>

</apex:pageBlockSection>

 

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
ShikibuShikibu
I figured it out. The solution is to wrap anything other than an inputField in a pageBlockSectionItem.

All Answers

ShikibuShikibu
I figured it out. The solution is to wrap anything other than an inputField in a pageBlockSectionItem.
This was selected as the best answer
VacharaVachara

Hi Shikibu,

 

I'm having the exact same problem as you did.  Can you please show me what you mean by "wrap anything other than an inputField in a pageBlockSectionItem"?  I've been searching all of the doc and on the internet.  I'm not having any luck.  I would really appreciate your help.  Thank you in advance.

 

Best,

Ta

ShikibuShikibu

<apex:pageBlockSection columns="2"> <apex:pageBlockSectionItem > <apex:outputLabel value="Account Name" for="the_account"/> <apex:outputLink value="/{!theAccount.Id}" id="the_account"> <apex:outputText value="{!theAccount.Name}"/> </apex:outputLink> </apex:pageBlockSectionItem> </apex:pageBlockSection>

 

Message Edited by Shikibu on 12-12-2009 10:19 PM
VacharaVachara

Hi Shikibu,

 

Thank you very much for the example.

 

Best,

Ta

Chandan3955Chandan3955

@Shikibu 

Thanks a lot..