Activity › Forums › Salesforce® Discussions › how to create tables in a Salesforce vf page?
-
how to create tables in a Salesforce vf page?
Posted by Bharath HN on January 8, 2019 at 12:41 PMhow to create tables in a vf page
Prachi replied 6 years, 8 months ago 4 Members · 3 Replies -
3 Replies
-
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
- [adinserter block='9']
-
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> -
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.