2

Can somebody please explain to me what is the usage of rows attribute of pageBlockTable in visualforce pages ?

I've searched for the same but still not found anything except - The number of rows in this page block table.

If I am not wrong, then number of rows of a pageBlockTable is decided by the size of list it has as a value. Then what is the use of rows attribute ?

1 Answer 1

2

"Rows" limit the no of rows to display on the Page .

Lets say your list has size of 10 rows but you still want to limit to 5 you can specify rows="5".

Please note same can also be done by putting a limit clause in the query if list is populated via query .

2
  • I also thought the same usage first, but when I tried to implement it, it was not showing any result. My list was having 4 elements, I specified rows="2". Still table had all the rows which were present in the list. What did I missed ?
    – Abbas
    Commented Mar 9, 2015 at 12:37
  • As per the @Mohith Shrivastava its working fine. **<apex:pageblockTable value="{!RegDisplayRecord}" var="Reg" rows="2"> ** Commented Mar 9, 2015 at 12:43

You must log in to answer this question.

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