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
Vijay Kumar Rebbala 1Vijay Kumar Rebbala 1 

How to display values in 4*7 format

<apex:page controller="Accountlistctrl">
    <apex:dataTable value="{!acctlist}" var="accs" columns="7" rows="{!rowcount}">
        <apex:outputField value="{!accs.Id}"/>


public class Accountlistctrl {

public list<Account> acctlist {get;set;}
public Integer rowcount {get;set;}

    public Accountlistctrl(){
        acctlist = [SELECT Id, Name FROM Account Limit 19];
        integer s = acctlist.size();
        system.debug('***********list size*************'+s);
        rowcount = Integer.valueOf(Math.ceil(s/7));

I'm sorry, there's not really enough of a question here for us to try and help you with. Are you wanting to display a grid of something?

You might look at using one of the bootstrap on salesforce css systems to do a grid of boxes if thats what your looking for?
Shashi PatowaryShashi Patowary
Thanks Kevin
@ Vijay - You can follow whatever Kevin has suggested.An simple way to implement grid in VF page is to use Apex:panelGrid -
<apex:page >
    <apex:panelGrid columns="4" id="myGrid" rules="all">
        <apex:outputText value="First" id="theFirst"/>
        <apex:outputText value="Second" id="theSecond"/>
        <apex:outputText value="Third" id="theThird"/>
        <apex:outputText value="Fourth" id="theFourth"/>
        <apex:outputText value="Fifth" id="theFifth"/>
        <apex:outputText value="Sixth" id="theSixth"/>
        <apex:outputText value="Seventh" id="theSeventh"/>
        <apex:outputText value="Eighth" id="theEighth"/>

This will result in

User-added image
You can change 'columns' or 'rules' according to your reuirement.This is a simple example only.

Please let me know if it helps.