I looked here: Array into a table with 5 cells in each row
but I cannot adapt my code..
I need to display PHP array results in a table. The table needs to have 3
To achieve something like this:

You can easily make things configureable by wrapping it into an iterator of it's own that provides rows and columns:
/**
* function to fetch one row from database
*/
function fetch_row($resultSet = NULL) {
static $result;
static $i = 0;
if ($resultSet) {
$result = $resultSet;
return;
}
return mysql_fetch_assoc($result);
}
fetch_row($result1); // initialize fetch function
$it = new FetchIterator('fetch_row');
$table = new TableIterator($it, 5);
if ($table->valid()) : ?>
$columns) : ?>
$column) : ?>
Some Demo and see as well Some PHP Iterator Fun.