Find your content:

Search form

You are here

Alignment is not correct


I have 6 attachment in a VF page. But the alignment is not right it i coming like this enter image description here

You can see the apex:inputfile in red. I am not able to understand why this is not coming right. Can anybody guide me what i am doing wrong. My VF page code is

<!--Receipt Upload-->
<apex:pageBlock >
<apex:pageBlockSection columns="3" title="Expense Receipt">
    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput" /> 
        <apex:inputFile value="{!attachment.body}" id="fileInput"
          filename="{!}" dir="RTL" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput1" />
        <apex:inputFile value="{!attachment1.body}" id="fileInput1"
          filename="{!}" dir="RTL1" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput2" />
        <apex:inputFile value="{!attachment2.body}" id="fileInput2"
          filename="{!}" dir="RTL2" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput3" />
        <apex:inputFile value="{!attachment3.body}" id="fileInput3"
          filename="{!}" dir="RTL3" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput4" />
        <apex:inputFile value="{!attachment4.body}" id="fileInput4"
          filename="{!}" dir="RTL4" accept=".xlsx,.pdf,.docx" size="50" />

    <apex:pageBlockSectionItem >
        <apex:outputLabel value="" for="fileInput5" />
        <apex:inputFile value="{!attachment5.body}" id="fileInput5"
          filename="{!}" dir="RTL5" accept=".xlsx,.pdf,.docx" size="50" />

Attribution to: AnuRaj

Possible Suggestion/Solution #1

It's a case of some delicious copypasta!

The dir attribute only accepts two values. "LTR" and "RTL". "LTR" is the default. Only your first inputFile has a valid value for the dir attribute, so all the others end up being the default "LTR" while the first is "RTL".

Just remove the dir attribute from all of em.

Attribution to: Phil Rymek
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content