How to create Label in Visualforce page?

How to create Label in Visualforce page?

To create Label in Visualforce page, apex:outputLabel tag is used.

Sample Code:

<apex:page showHeader=”false” controller=”Sample” >
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection columns=”1″ title=”Member Information”>
            <apex:pageBlockSectionItem >
                <apex:outputLabel value=”Name”/>
                <apex:inputText />
            </apex:pageBlockSectionItem>
            <apex:pageBlockSectionItem >              
                <apex:outputLabel value=”Age”/>
                <apex:inputText />
            </apex:pageBlockSectionItem>         
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>   
</apex:page>

Output:


Leave a Reply