public class AccountExtention {
    // retrieves the list of accounts backing the page
    public List<Account> accs;
    public List<RowWrapper> rows;
public List<Account> getAccounts()
{
    if (null==accs)
    {
        accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode from Account
              where BillingCity != null and BillingPostalCode!=null limit 3];
    }
     
    return accs;
}
 
// retrieves the list of row wrappers
public List<RowWrapper> getRowWrappers()
{
    if (null==rows)
    {
        rows=new List<RowWrapper>();
         
        // create a row for each field - there are 4 of these, Name, Street, City and PostCode
        for (Integer idx=0; idx<4; idx++)
        {
            rows.add(new RowWrapper());
        }
         
        // iterate the accounts and populate the rows
        for (Integer idx=0; idx<getAccounts().size(); idx++)
        {
            rows[0].addValue(getAccounts()[idx].Name);
            rows[1].addValue(getAccounts()[idx].BillingStreet);
            rows[2].addValue(getAccounts()[idx].BillingCity);
            rows[3].addValue(getAccounts()[idx].BillingPostalCode);
        }
    }
     
    return rows;
}

}