Table of data.apex

Image:cookbook.jpg

Force.com Cookbook Sample Code
Chapter 13/1(depending on Cookbook version): Getting Started with Visualforce - Building a Table of Data in a Visualforce Page

To download all the code samples, access the Cookbook. - Image:Key_icon.gif

public class mySecondController {
	public Account getAccount() {
		return [select id, name, (select id, firstname, lastname from Contacts limit 5)
				from Account where id = :System.currentPageReference().getParameters().get('id')];
	}

	public String getName() {
		return 'My Second Custom Controller';
	}
}

Sample code provided by salesforce.com. All rights reserved.