Hello all,
I have the following custom code in my events tab.
With this code I get my results grouped by year:
1992
---------
january 1992
februari 1992
march 1992
1991
---------
january 1991
februari 1991
march 1991
The second thing I would like to do is displaying the data not verticaly, but horizontally. Like:
1992
---------
january 1992 februari 1992 march 1992
1991
---------
january 1991 februari 1991 march 1991
But how do you do this? In my code above the column part isn't working, but I can't figure out what.
Regards,
Ruud
I have the following custom code in my events tab.
<table>
<?php
$jaartal = '';
foreach($form->data['ACE'] as $record):
{
if( $jaartal != $record['jaartal'] )
{
echo "<tr><td id='jaartal'>".( $record['jaartal'] )."</td></tr>";
$jaartal = $record['jaartal'];
}
}
$columns = 2; //No of column
$dataToDisplay = array($record['naam']);
$columnwidth = 100/$columns;
$count = count($dataToDisplay);
$i =0;
foreach($dataToDisplay as $data) {
if($i % $columns == 0){
echo "<tr>";
}
echo "<td>" . $data . "</td>";
if(($i % $columns) == ($columns - 1) || ($i + 1) == $num_rows){
echo "</tr>";
}
$i++;
}
endforeach;
?>
</table>
With this code I get my results grouped by year:
1992
---------
january 1992
februari 1992
march 1992
1991
---------
january 1991
februari 1991
march 1991
The second thing I would like to do is displaying the data not verticaly, but horizontally. Like:
1992
---------
january 1992 februari 1992 march 1992
1991
---------
january 1991 februari 1991 march 1991
But how do you do this? In my code above the column part isn't working, but I can't figure out what.
Regards,
Ruud