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
RRC007RRC007 

Aligning VF Page Columns

I have a VF page that displays Account and related Opportunities. I cannot align my totals to the proper columns as the last row on the page. Any advice?

 

Here's my first initial crack at this: 

 

<apex:pageBlock title="IN-FLIGHT OPPORTUNITIES">

        <apex:pageBlockSection columns="1">

          <apex:pageblockTable value="{!Opportunities}"  var="opps" border="0" cellspacing="0" cellpadding="0" >

              <apex:column style="width:40%" headervalue="Name"> <apex:outputfield value="{!opps.Name}"/> </apex:column>

              <apex:column style="width:10%;text-align:right;" headervalue="Total Contract Value">

                 <apex:outputfield value="{!opps.Total_Contract_Amount__c}"/></apex:column>

              <apex:column style="width:10%;text-align:right;" headervalue="Revenue Current Yr">

                 <apex:outputfield value="{!opps.Projected_Current_Year_Revenue__c}"/> </apex:column>

              <apex:column style="width:10%;text-align:right;" headervalue="Revenue Next Yr">

                 <apex:outputfield value="{!opps.Projected_Next_Year_Revenue__c}"/> </apex:column>

              <apex:column style="width:20%" headervalue="CBP Stage"> <apex:outputfield value="{!opps.StageName}"/> </apex:column>

              <apex:column style="width:10%" headervalue="Close Date"> <apex:outputfield value="{!opps.CloseDate}"/> </apex:column> 

          </apex:pageblockTable>

          

          <apex:dataTable value="{!Account}" var="a" border="0" cellspacing="0" cellpadding="0" style="font-weight:bold;">  

             <apex:column > <apex:outputText value="Totals"> </apex:outputText> </apex:column>

             <apex:column style="text-align:right"> <apex:outputField value="{!a.Grand_Total_Opps_Contract_Value__c}"/> </apex:column>                                   

             <apex:column style="text-align:right"> <apex:outputField Value="{!a.Grand_Total_Opps_Revenue_Current_Yr__c}"/> </apex:column>

             <apex:column style="text-align:right"> <apex:outputField Value="{!a.Grand_Total_Opps_Revenue_Next_Yr__c}"/> </apex:column>

          </apex:dataTable>

 

Output shows: Totals$xxxxxxx $xxxxxxxx $xxxxxxx 

 

AvromAvrom

Instead of using a separate data table to display the (one) account, how about using the

footerValue attribute of the <apex:column> component?

 

<apex:column style="width:10%;text-align:right;" headervalue="Total Contract Value"

footerValue="{!Account.Grand_Total_Opps_Contract_Value__c}">

<apex:outputfield value="{!opps.Total_Contract_Amount__c}"/></apex:column>

 


 

Message Edited by Avrom on 03-11-2010 03:36 PM
RRC007RRC007
Avrom - that could work...do i need to apply another "right justify" command for the footer value? Also, the value is not being displayed in $$s. Will I need to format that differently?