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

Controlling distance / spacing between outputLabel and other components

I am creating a custom visualforce page with custom controller.  Several of my properties return non-sobject values such as string and boolean types.  As such no automatic label is created and I must use the outputLabel component.  When I do this as in the code sample below, the spacing between the label and bound field component are so great that it is confusing to the eye.  How would I go about specifying a tighter spacing? 



<apex:pageBlockSection title="Spacing Test">
		<apex:outputLabel value="Checkbox" for="theCheckbox"/>
		<apex:inputCheckbox value="{!inputValue}" id="theCheckbox"/>


I have also tried simply putting raw text next to the input component such as:



<apex:pageBlockSection title="Spacing Test">
		ToCheckorNotToCheck<apex:inputCheckbox value="{!inputValue	id="theCheckbox"/>









Use following :

<apex:pageBlockSection title="Spacing Test">
ToCheckorNotToCheck &nbsp; &nbsp; &nbsp;<apex:inputCheckbox value="{!inputValue id="theCheckbox"/>


try this one and see the magic.


To provide the space between label and component use :


<label style="padding-left:20px" >// text here</label>


Hope this helps.