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
Patricia LimPatricia Lim 

How to center align button in Visualforce

Hi all. I have a pageBlockSection before the button that specifies 2 columns and I suspect this is why I cannot center my button despite using 
<div align="center">
Here is my VF markup:
<apex:pageBlock title="Added Participants">
    <apex:pageBlockTable id="people" value="{!allcontacts}" var="participant">
        <apex:column headervalue="First Name" value="{!participant.Name}"/> 
        <apex:column headerValue="Last Name" value="{!participant.Last_Name__c}"/>
        <apex:column headerValue="Age" value="{!participant.Age__c}"/>
        <apex:column headerValue="Phone" value="{!participant.Phone__c}"/>
        <apex:column headerValue="Victim/Offender" value="{!participant.Victim_Offender__c}"/>
        <!--Submit button-->
      <apex:pageBlockButtons location="bottom">
            <apex:commandButton action="{!save}" value="Submit Referral"/>
        <p>By clicking this button, you are agreeing to start the registration process.</p>
        <div style="text-align:center">
      <p>© 2020. All rights reserved.</p>
Advice is appreciated
ShirishaShirisha (Salesforce Developers) 
Hi Patricia,


The below sample code should work in your visualforce page:
<div align="center" draggable="false" >
<apex:commandButton value="Save" action="{!save}"/>

Kindly mark it as best answer if it helps so that it can help others in the future.

Warm Regards,
Shirisha Pathuri