How to add space between two inputText components in apex:form?

    <apex:inputText value="{!inputValue1}"/>
    ... Add space here ...
    <apex:inputText value="{!inputValue2}"/>

1 Answer 1


You can use normal html tags like <br/> or &nbsp;. You could also use the styleClass attribute and use css to add paddings or margins as well.

See here for more info on styling in SF


  • 2
    HTML collapses whitespace. You can do as the ninja suggested or use &nbsp; -- a space character that will not collapse.
    – Phil Rymek
    Oct 30, 2013 at 21:07
  • Yes, &nbsp; is a good alternative as well Oct 30, 2013 at 21:11
  • I tried nbsp;, and it works great! Thanks @PhilR and @SF_Ninja!
    – Mingyu
    Oct 30, 2013 at 21:14
  • No prob, glad to help Oct 30, 2013 at 21:21
  • I have a <apex:outputlabel value="<Need to Insert Blank space here>"/> ? How can i do that any idea? Apr 25, 2014 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.