I need to display all case records which are present in organization in a table format by using visualforce page

2 Answers 2


You should refer to Salesforce Trailhead and the Visualforce Basics module. The chapter 'Displaying Records, Fields and Tables' will show you how to achieve this.

Display A Table

Use to add a table of data to a page. What exactly is a related list? What does do when you add it to a page? It grabs a list of similar data elements. For example, a list of contacts for the account. It sets up a table with columns for each field, headers atop each column, and so on. For each item in the list—for each related contact—it adds a row to the table, and fills in each column with the appropriate field from that record. You can do the same thing in your own Visualforce markup using iteration components. An iteration component works with a collection of similar items, instead of on a single value. For example, {!Account.contacts} is an expression that evaluates to a list of contacts for an account. You can use this expression with an iteration component to create a list or table with details of these related contacts.

<apex:pageBlock title="Contacts">
   <apex:pageBlockTable value="{!Account.contacts}" var="contact">
      <apex:column value="{!contact.Name}"/>
      <apex:column value="{!contact.Title}"/>
      <apex:column value="{!contact.Phone}"/>

A table listing the account’s contacts is added to the page, with just the columns you’ve chosen.

The key Visualforce attribute here is apex:pageBlockTable. This tag generates the markup for a list view or related list table in the Force.com GUI. It is bound to a collection of objects and each row rendered is an item in that collection.

  1. Use below blog for custom pagination. Instead of Account object use Case object.


  1. Pagination with a List Controller


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .