2

I've set my apex:pageBlockTable 'rows' attribute to 10 but it is collapsed when there are less than 10 records in the table. Is there a way to keep the number of rows fixed? Or will I have to switch to pure HTML table?

Thanks in advance!

1 Answer 1

1

You could add empty objects to the collection that the table is displaying (assuming you have a controller). Using Contact as an example and assuming <apex:pageBlockTable value="{!rows}" ...>

public Contact[] getRows() {
    Contact[] rows = [select Name from Contact limit 4];
    for (Integer i = rows.size(); i < 10; i++) {
        rows.add(new Contact());
    }
    return rows;
}
1
  • Thanks Keith! I ended up mixing your solution with html table + apex:repeat for its rows.
    – user39399
    Commented Jul 17, 2015 at 9:06

You must log in to answer this question.

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