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
css223css223 

Alignment of VF page on standard page

I am just getting started with VF pages, so please forgive me if this is a basic question.

 

I have added an Active (checkbox) object to the contact page. If unchecked, I want the Inactive date to be displayed.

 

I've successfully coded the VF page and added it to my Account page layout. If the contact is active, nothing is displayed. If the contact is not active, the date is displayed.

 

But the alignment is off. While the fields on the standard contact page have their labels right aligned & the data left aligned, the VF page I've added is left aligned.

 

Here's a sample:

 

         Contact Owner  John Doe

                         Name  Sam Smith

         Account Name  ABC Industries

                        Active  (unchecked box)

Inactive Date  09/19/2013

 

 (Sorry...I don't know how to post a picture on the board).

 

Here's the code for the VF page:

 

<apex:page standardController="Contact">

        <apex:form >

            <apex:pageblock id="InactiveDtPageBlock" mode="maindetail">

                <apex:actionregion >

                <apex:pageblocksection columns="1" rendered="{!contact.Active__c == False}">

                    <apex:outputField value="{!Contact.Inactive_Date__c}"/>

                </apex:pageblocksection>

                </apex:actionregion>

            </apex:pageblock>

        </apex:form>

     <script>

        function setFocusOnLoad(){}

     </script>

</apex:page>

 

Is there a way to align the Inactive Date the same as the other fields?

 

Thanks,

Connie