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
Mathew Andresen 5Mathew Andresen 5 

line up two data tables

Hi,

I have two data tables, the top one provides summary information for the bottom one.  But they don't always line up even though they have the same number of columns, and I use the width parameter on the data tables to make sure they are the same size..  Is there a good way to make sure the columns from the top and bottom data table always line up.  

Thanks,
 
Jayamaruthyraman JaganathJayamaruthyraman Jaganath
Can you post your code please?
Mathew Andresen 5Mathew Andresen 5
sure
 
<apex:page controller="AccountGoals_Class"  sidebar="false">
 
   
    <apex:form >
<!-- control section **********************************  -->          
<apex:pageblock title="Account Quarterly Forecast (in calendar Qtrs)">
    <apex:pageblockbuttons >
        <apex:commandbutton action="{!save}" value="Save"/>
    </apex:pageblockbuttons>
    <apex:pageblocksection >
        
                <apex:pageblocksectionitem >
        <apex:outputlabel for="startdate" value="Start Date of Quarter:" />
        <apex:inputfield value="{!startForecast.Forecast_Quarter__c}" id="startdate"> 
            <apex:actionSupport event="onchange" action="{!selectedDateAction}" />
         </apex:inputfield>
        </apex:pageblocksectionitem>
        
        <apex:pageblocksectionitem >
        <apex:outputlabel for="searchBox" value="Account Search:" />
        <apex:inputtext value="{!searchText}" id="searchBox">
            <apex:actionSupport event="onkeyup" action="{!selectedTextAction}" />
            </apex:inputtext>
        </apex:pageblocksectionitem>
        
        <apex:pageblocksectionitem >
        <apex:outputlabel for="repSelector" value="Rep Selector" />
        <apex:selectList size="1" value="{!selectedRep}" id="repSelector">
            <apex:selectOptions value="{!repNameOptionList}"/>
            <apex:actionSupport event="onchange" action="{!selectedRepAction}" />
         </apex:selectList>
        </apex:pageblocksectionitem>
         
      
   <apex:pageblocksectionitem >
        <apex:outputlabel for="numOfAccounts" value="Number of Accounts:" />
        <apex:inputtext value="{!limitVar}" id="numOfAccounts">
            <apex:actionSupport event="onchange" action="{!numOfAccounts}" />
        </apex:inputtext>           
 
        </apex:pageblocksectionitem>
    </apex:pageblocksection>
        
    
    
<!-- *********  Forecast Summary section **************  -->
     <apex:pageblocksection title="Forecast Summary" columns="1">
        <apex:pageblocktable value="{!summaryResultList}" var="v" width="100%">
                <apex:column width="10%"> 
                   <apex:facet name="header"></apex:facet>
                  <apex:outputText >{!v.name}</apex:outputText>
                </apex:column>
            <apex:column width="{!colwidth}%"/>
                <apex:column width="{!colwidth}%"> 
                  <apex:facet name="header">{!nameQM4}</apex:facet>  <apex:outputText value="{0,number,$###,###,##0}"> <apex:param value="{!v.salesQ4}"/> </apex:outputText> 
                
                </apex:column>
                <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">{!nameQM3}</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.salesQ3}"/></apex:outputtext>                   
                  
                </apex:column> 
                <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">{!nameQM2}</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.salesQ2}"/></apex:outputtext>                   
                   
               </apex:column>             
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">{!nameQM1}</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.salesQ1}"/></apex:outputtext>  

           </apex:column>             

            
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">Sales Total</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.salesTotal}"/></apex:outputtext>                   
                    
               </apex:column>             
               <apex:column width="1%" /> <!-- ******* break col ****************************************** -->
                
            
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">{!nameQF1}</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.forecastQ1}"/></apex:outputtext>                   
                    
               </apex:column>             
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">{!nameQF2}</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.forecastQ2}"/></apex:outputtext>                   
                   
               </apex:column>             
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">{!nameQF3}</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.forecastQ3}"/></apex:outputtext>                   
                   
               </apex:column>             
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">{!nameQF4}</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.forecastQ4}"/></apex:outputtext>                   
                    
               </apex:column>                 
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">Forecast Total</apex:facet> <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!v.forecastTotal}"/></apex:outputtext>                   
                    
               </apex:column>            
              <apex:column width="1%"/> <!-- ******** break col  ******************************************************** -->
            
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">Q1 % Growth</apex:facet> <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!v.Q1Growth}"/></apex:outputtext>%                  
                  
               </apex:column> 
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">Q2 % Growth</apex:facet> <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!v.Q2Growth}"/></apex:outputtext>%                  
                    
               </apex:column>  
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">Q3 % Growth</apex:facet> <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!v.Q3Growth}"/></apex:outputtext>%                  
                   
               </apex:column>  
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">Q4 % Growth</apex:facet> <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!v.Q4Growth}"/></apex:outputtext>%                  
                   
               </apex:column>  
               <apex:column width="{!colwidth}%"> 
                    <apex:facet name="header">Total % Growth</apex:facet> <apex:outputtext value="{0,number,###,###,##0}" ><apex:param value="{!v.totalGrowth}"/></apex:outputtext>%                  
                    
               </apex:column>          
       <!--     <apex:column width="1%" />  ******** end col  ******************************************************** -->
          </apex:pageblocktable>
    </apex:pageblocksection>
    

        
 <!-- account detail section **********************************  -->        
    
    <apex:pageblocksection title="Account Details" columns="1">
    <apex:pageblocktable value="{!completeRowList}" var="row" width="100%">
         <apex:column width="8%" headerValue="Account">
           
            <apex:outputlink value="{!URLFOR($Action.Account.View, row.accountID)}"> <apex:outputtext >{!row.name}</apex:outputtext></apex:outputlink>
        </apex:column>
        <apex:column width="{!colwidth}%">
            <apex:facet name="header">Owner</apex:facet>
            <apex:outputtext value="{!row.ownerName}"></apex:outputtext>        
        </apex:column>        
        
        <apex:column width="{!colwidth}%">
            <apex:facet name="header">Forecasting</apex:facet>
            <apex:inputcheckbox value="{!row.forecastCheckBox}"></apex:inputcheckbox>        
        </apex:column>
        
<!-- sales -->
        <apex:repeat value="{!periodYearList}" var="periodYear">
            
            <apex:column width="{!colwidth}%" rendered="{!if(periodYear=goalString ,false, true)}">
                <apex:facet name="header">
                    <apex:commandlink action="{!sortAction}" value="{!periodYear}"  >
                        <apex:param value="{!periodYear}"  name="SORT_BY" assignTo="{!SORT_BY}" ></apex:param>  
                    </apex:commandlink>
                </apex:facet>                
               <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!row.salesAmountMap[periodYear]}"/></apex:outputtext> 
            </apex:column>
        </apex:repeat>
           
         <apex:column width="{!colwidth}%">
                <apex:facet name="header">
                    <apex:commandlink action="{!sortAction}" value="Sales Total"  >
                        <apex:param value="Sales Total"  name="SORT_BY" assignTo="{!SORT_BY}" ></apex:param>  
                    </apex:commandlink>
                </apex:facet>           
        <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!row.salesLineTotal}"/></apex:outputtext> 
        </apex:column>
       <apex:column width="1%"/> <!-- ******** break col  ******************************************************** -->

     
 <!-- forecast -->        
        <apex:repeat value="{!forecastYearList}" var="periodYear">
       <apex:column width="{!colwidth}%">
                <apex:facet name="header">
                    <apex:commandlink action="{!sortAction}" value="{!periodYear}"  >
                        <apex:param value="{!periodYear}"  name="SORT_BY" assignTo="{!SORT_BY}" ></apex:param>  
                    </apex:commandlink>
                </apex:facet>              
           <apex:inputtext value="{!row.forecastAmountMap[periodYear].Forecast_Revenue__c}"  ></apex:inputtext> <!-- size="4" -->
          </apex:column>
        </apex:repeat>
          
         <apex:column width="{!colwidth}%">
                <apex:facet name="header">
                    <apex:commandlink action="{!sortAction}" value="Forecast Total"  >
                        <apex:param value="Forecast Total"  name="SORT_BY" assignTo="{!SORT_BY}" ></apex:param>  
                    </apex:commandlink>
                </apex:facet>          
        <apex:outputtext value="{0,number,$###,###,##0}" ><apex:param value="{!row.forecastLineTotal}"/></apex:outputtext> 
        </apex:column>  
        <apex:column width="1%"/> <!-- ******** break col  ******************************************************** -->
<!-- Growth Change -->
        <apex:repeat value="{!growthYearList}" var="periodYear">
       <apex:column width="{!colwidth}%">
                <apex:facet name="header">
                    <apex:commandlink action="{!sortAction}" value="{!periodYear}"  >
                        <apex:param value="{!periodYear}"  name="SORT_BY" assignTo="{!SORT_BY}" ></apex:param>  
                    </apex:commandlink>
                </apex:facet>                
            <apex:outputtext value="{0,number,###,###,##0%}" ><apex:param value="{!row.growthChangeMap[periodYear]}"/></apex:outputtext>        
          </apex:column>
        </apex:repeat>
         <apex:column width="{!colwidth}%" >
                <apex:facet name="header">
                    <apex:commandlink action="{!sortAction}" value="Total % Growth"  >
                        <apex:param value="Total % Growth"  name="SORT_BY" assignTo="{!SORT_BY}" ></apex:param>  
                    </apex:commandlink>
                </apex:facet>        
        <apex:outputtext value="{0,number,###,###,##0%}" ><apex:param value="{!row.totalGrowth}"/></apex:outputtext> 
        </apex:column>
        <apex:column />        

<!-- **********************8  -->        
        </apex:pageblocktable>
            </apex:pageblocksection>
    </apex:pageblock>
        </apex:form>
 </apex:page>