+ Start a Discussion
mgodseymgodsey 

Right justify in apex:pageblocktable with extra padding

I've right justified a numerical column in an apex:pageblocktable, but it's right next to a text column that is left-justified. I want to add a bit of extra spacing between the two columns, but nothing seems to be working. Below are two things I've tried (I've only included the relevant markup) - can anyone please point out where I'm going wrong?

Thanks!
 
        .number{
            text-align: right;
        }
        .ruiColumnWidth{
            width: 15%;
        }
        .ruiMonthEven{
            background: #F5F5F5;
        }
        .ruiMonthOdd{
        }

<apex:pageBlockTable value="{!ruiWrappers}" var="wrapper" cellpadding="5">
     <apex:column headerValue="Amount" styleClass="number ruiColumnWidth {!IF(wrapper.monthType == 'Even', 'ruiMonthEven', 'ruiMonthOdd')}" headerClass="number">
          <apex:outputField value="{!wrapper.rui.RuiPipeline__c}"/>
     </apex:column>
     <apex:column headerValue="Probability" styleClass="ruiColumnWidth {!IF(wrapper.monthType == 'Even', 'ruiMonthEven', 'ruiMonthOdd')}">
            <apex:outputText value="{!wrapper.ruiProbability}"/>
     </apex:column>
</apex:pageBlockTable>
.number{
    text-align: right;
    padding-right: 5px;
}
.ruiColumnWidth{
    width: 15%;
}
.ruiMonthEven{
    background: #F5F5F5;
}
.ruiMonthOdd{
}

<apex:pageBlockTable value="{!ruiWrappers}" var="wrapper">
     <apex:column headerValue="Amount" styleClass="number ruiColumnWidth {!IF(wrapper.monthType == 'Even', 'ruiMonthEven', 'ruiMonthOdd')}" headerClass="number">
          <apex:outputField value="{!wrapper.rui.RuiPipeline__c}"/>
     </apex:column>
     <apex:column headerValue="Probability" styleClass="ruiColumnWidth {!IF(wrapper.monthType == 'Even', 'ruiMonthEven', 'ruiMonthOdd')}">
            <apex:outputText value="{!wrapper.ruiProbability}"/>
     </apex:column>
</apex:pageBlockTable>

User-added image
 
salesforce@14salesforce@14
Hi mgodsey,

             Try in your code by giving padding-left also.

Thanks
mgodseymgodsey
Thanks for the suggestion. I gave it a shot, but no difference, unfortunately. Even if I set it to an exaggerate large number, nothing changes, so it seems to be ignoring it?