function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

difference between pageblock table and data table..?

Can any body tell me what are the exact differences between pageblock table and data table..?


From the docs:


The body of the <apex:pageBlockTable> contains one or more column components that specify what information should be displayed for each item of data, similar to a table. Unlike the <apex:dataTable> component, the default styling for <apex:pageBlockTable> matches standard Salesforce styles. Any additional styles specified with <apex:pageBlockTable> attributes are appended to the standard Salesforce styles.



Hope this helps!



Satish Kumar

Grazitti InteractiveGrazitti Interactive




  • PageBlockTable should be define inside pageblock or pageblocksection.
  • PageBlockTable uses standard styles sheets to design a visualpage.
  • It has the  required attribute "value".
  • Column headers  will be displayed automatically.
  • No need to write inside pageblock or pageblocksection.
  • There is no required value.
  • The  data can be displayed using  custom style sheets.
  • we need to specify column headers explicitly.




Amith RaoAmith Rao
Corrected the above :-
  • Difference between the PageBlockTable and DataTable?
PageBlockTable: ---
  1. PageBlockTable uses the Standard style sheets to design the Visual force.
  2. Column Headers will be displayed automatically.
  3. PageBlockTable should be defined inside pageblock or pageblocksection.
DataTable: ---
  1. Data can be displayed using the custom style sheets(CSS).
  2. Column headers need to be specified explicitly.
  3. No need to specify within the Pageblock or Pageblocksection.

Note:----    Value is a required attribute for both DataTable and PageBlockTable.
Please correct me if anybody has a strong answer on this?

Please select the Best answer if you feel after reforming the answer in
Like it if it is correct.

Amith S Rao (Watch viodes on "SFDC Amith"
SFDC Consultant/Admin/Trainer/Developer