Activity Forums Salesforce® Discussions how to create tables in a Salesforce vf page?

  • Jade

    Member
    January 9, 2019 at 6:06 am

    Hi Bharat,

    We have various tags like <apex:pageBlockTable>, <apex:DataTable> to create table in VF page.

    Please find more details at: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_quick_start_iteration_components.htm

  • Hariom Chaudhary

    Member
    August 14, 2019 at 9:58 am

    Hi,

    Some Visualforce components, such as <apex:pageBlockTable> or <apex:dataTable>, allow you to display information from multiple records at a time by iterating over a collection of records.

    To illustrate this concept, the following page uses the <apex:pageBlockTable> component to list the contacts associated with an account that is currently in context:

    <apex:page standardController="Account">
    <apex:pageBlock title="Hello {!$User.FirstName}!">
    You are viewing the {!account.name} account.
    </apex:pageBlock>
    <apex:pageBlock title="Contacts">
    <apex:pageBlockTable value="{!account.Contacts}" var="contact">
    <apex:column value="{!contact.Name}"/>
    <apex:column value="{!contact.MailingCity}"/>
    <apex:column value="{!contact.Phone}"/>
    </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:page>

  • Prachi

    Member
    August 22, 2019 at 1:45 am

    Hi,

    There are various tags like <apex:pageBlockTable>, <apex:DataTable> to create table in VF page.

    Here is an example-

    <apex:page standardController="Account">
    <apex:pageBlock title="Hello {!$User.FirstName}!">
    </apex:pageBlock>
    <apex:pageBlock title="Contacts">
    <apex:pageBlockTable value="{!account.Contacts}" var="contact">
    <apex:column value="{!contact.Name}"/>
    <apex:column value="{!contact.MailingCity}"/>
    <apex:column value="{!contact.Phone}"/>
    </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:page>

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos