
Force.com Cookbook Sample Code
Chapter 13: Getting Started with Visualforce - Building a Table of Data in a Visualforce Page
To download all the code samples, access the Cookbook. -
<apex:page controller="mySecondController" tabStyle="Account">
<apex:pageBlock title="Hello {!$User.FirstName}!">
You belong to the {!account.name} account.
</apex:pageBlock>
<apex:pageBlock title="Contacts">
<apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4" border="1">
<apex:column>{!contact.FirstName}</apex:column>
<apex:column>{!contact.LastName}</apex:column>
</apex:dataTable>
</apex:pageBlock>
</apex:page>
Sample code provided by salesforce.com. All rights reserved.