How to Use apex:column in Visualforce page?

<apex:column>

            A single column in a table. An < apex:column >component must always be a child of an < apex:dataTable >or < apex:pageBlockTable > component.

This tag supports following attributes:

Attribute

Description

breakBefore
A Boolean value that specifies whether the column should begin a new row in the table. If set to true, the column begins a new row. If not specified, this value defaults to false.
colspan
The number of columns that this column spans in the table. Note that this value does not apply to the header and footer cells.
dir
The direction in which text in the generated column should be read. Possible values include "RTL" (right to left) or "LTR" (left to right). Note that this value does not apply to the header and footer cells.
footerClass
The style class used to display the column footer, if defined. This attribute is used primarily to designate which CSS styles are applied when using an external CSS stylesheet.
footercolspan
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footerdir
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footerlang
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronclick
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footerondblclick
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronkeydown
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronkeypress
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronkeyup
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronmousedown
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronmousemove
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronmouseout
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronmouseover
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footeronmouseup
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footerstyle
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footertitle
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
footerValue
The text that should be displayed in the column footer. If you specify a value for this attribute, you cannot use the column's footer facet.
headerClass
The style class used to display the table header, if defined. This attribute is used primarily to designate which CSS styles are applied when using an external CSS stylesheet.
headercolspan
The number of columns that the header column spans in the table, if defined. This attribute cannot be used in Visualforce page versions 16.0 and above.
headerdir
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headerlang
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronclick
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headerondblclick
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronkeydown
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronkeypress
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronkeyup
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronmousedown
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronmousemove
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronmouseout
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronmouseover
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headeronmouseup
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headerstyle
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headertitle
This attribute was deprecated in Salesforce API version 16.0 and has no effect on the page.
headerValue
The text that should be displayed in the column header. If you specify a value for this attribute, you cannot use the column's header facet. Note also that specifying a value for this attribute overrides the default header label that appears if you use an inputField or outputField in the column body.
id
An identifier that allows the column component to be referenced by other components in the page.
lang
The base language for the generated HTML output, for example, "en" or "en-US".
onclick
The JavaScript invoked if the onclick event occurs in the column --that is, if the column is clicked. Note that this value does not apply to the header and footer cells.
ondblclick
The JavaScript invoked if the ondblclick event occurs in the column--that is, if the column is clicked twice. Note that this value does not apply to the header and footer cells.
onkeydown
The JavaScript invoked if the onkeydown event occurs in the column --that is, if the user presses a keyboard key. Note that this value does not apply to the header and footer cells.
onkeypress
The JavaScript invoked if the onkeypress event occurs in the column--that is, if the user presses or holds down a keyboard key. Note that this value does not apply to the header and footer cells.
onkeyup
The JavaScript invoked if the onkeyup event occurs in the column--that is, if the user releases a keyboard key. Note that this value does not apply to the header and footer cells.
onmousedown
The JavaScript invoked if the onmousedown event occurs in the column--that is, if the user clicks a mouse button. Note that this value does not apply to the header and footer cells.
onmousemove
The JavaScript invoked if the onmousemove event occurs in the column--that is, if the user moves the mouse pointer. Note that this value does not apply to the header and footer cells.
onmouseout
The JavaScript invoked if the onmouseout event occurs in the column--that is, if the user moves the mouse pointer away from the column. Note that this value does not apply to the header and footer cells.
onmouseover
The JavaScript invoked if the onmouseover event occurs in the column--that is, if the user moves the mouse pointer over the column. Note that this value does not apply to the header and footer cells.
onmouseup
The JavaScript invoked if the onmouseup event occurs in the column--that is, if the user releases the mouse button. Note that this value does not apply to the header and footer cells.
rendered
A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true.
rowspan
The number of rows that each cell of this column takes up in the table.
style
The style used to display the column, used primarily for adding inline CSS styles. Note that this value does not apply to the header and footer cells.
styleClass
The style class used to display the column, used primarily to designate which CSS styles are applied when using an external CSS stylesheet. Note that this value does not apply to the header and footer cells.
title
The text to display as a tooltip when the user's mouse pointer hovers over this component.
value
The text that should be displayed in every cell of the column, other than its header and footer cells. If you specify a value for this attribute, you cannot add any content between the column's opening and closing tags.
width
The width of the column in pixels (px) or percentage (%). If not specified, this value defaults to 100 pixels.

Example:
<apex:page standardController="Lead" recordSetVar="Leads">

     <apex:pageBlock title="Columns">
         <apex:pageBlockTable value="{!Leads}" var="le">
             <apex:column value="{!le.name}"/> 
             <apex:column value="{!le.Phone}"/>
             <apex:column value="{!le.Company}"/>
             <apex:column value="{!le.Status}"/>
             <apex:column value="{!le.Email}"/>
         </apex:pageBlockTable> 
     </apex:pageBlock> 
 </apex:page>

The above code generated the below page:

VF_columns

COMMENTS

Name

Apex Apex Default Methods Apex Methods Apex_Collections Apps Batch Apex Books CRM eBooks Data Import Wizard Data Management DataLoader Dataloader.io Difference Between Error in Salesforce FAQ's FAQ's-Apex FAQ's-Apps FAQ's-CRM FAQ's-Data loader FAQ's-SOQL & SOSL FAQ'S-Triggers FAQ's-User Profile & Security FAQ's-VF Force.com Explorer Force.com Ide Formulas & Functions Integration Interview Questions Only Latest_Updates Limits&Best Practices Online-Training Reports and Dashboards Salesforce Deployment Salesforce Realtime Examples On Development Salesforce Realtime Task On Admin Salesforce Realtime Tasks Salesforce Realtime Tasks- Apex Salesforce Training Salesforce1 Mobile Sites SOQL Spring'14 Release Triggers User Profile & Security VF Tags VisualForce Winter'14 Release Wizard for Accounts/Contacts Workbench Workflows and Approvals
false
ltr
item
Sfdc Gurukul- All in one place for salesforce and force.com step by step tutorial for beginners: How to Use apex:column in Visualforce page?
How to Use apex:column in Visualforce page?
How to Use apex:column in Visualforce page?,apex:column,,using column tag in visualforce,visualforce column,salesforce column tag in visualforce
http://3.bp.blogspot.com/-NLCMifEQg9U/UfYFkHUoMbI/AAAAAAAAAZE/-qjShnIcLIk/s640/VF_columns.JPG
http://3.bp.blogspot.com/-NLCMifEQg9U/UfYFkHUoMbI/AAAAAAAAAZE/-qjShnIcLIk/s72-c/VF_columns.JPG
Sfdc Gurukul- All in one place for salesforce and force.com step by step tutorial for beginners
http://sfdcgurukul.blogspot.in/2013/07/apexcolumn.html
http://sfdcgurukul.blogspot.in/
http://sfdcgurukul.blogspot.com/
http://sfdcgurukul.blogspot.com/2013/07/apexcolumn.html
true
4199533888133360731
UTF-8
Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy