Footer right align in apex:pageBlockTable Salesforce

The CSS style float:right;, helps in Footer right align in apex:pageBlockTable.

Sample Code:

Visualforce page:

<apex:page docType="html-5.0" controller="Sample">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!listAccount}" var="a">
            <apex:column value="{!a.Name}"/>
            <apex:column value="{!a.AnnualRevenue}" style="text-align:right;">
                <apex:facet name="footer">
                    <apex:outputText value="${0, number, ###,###,###,##0.00}" style="float:right;">
                        <apex:param value="{!totalRevenue}" />



public class Sample {
    public List<Account> listAccount {get;set;}
    public Double totalRevenue {get;set;}
    public Sample() {
        totalRevenue = 0;
        listAccount = [SELECT Name, AnnualRevenue FROM Account];
    private void calculateTotalRevenue() {
        for(Account acct : listAccount) {
            if(acct.AnnualRevenue != null)
                totalRevenue += acct.AnnualRevenue;



No comments:

Post a Comment

Sharing is Caring!!! Share this with your friends!!!

submit to reddit