
petejdg
User
Dec 9, 2011, 11:33 AM
Post #1 of 6
(698 views)
Shortcut
|
|
splitting list results into two columns
|
Can't Post
|
|
I have seen a few different examples but didn't get anything to work right for me. I have a calendar of events looping through by month and then record, but I am wondering if I can look at the months inputted and split them into two columns. They might not have twelve months filled in. This is an example:http://www.jdgordonadvertising.com/cfs_volunteer/calendar/index.php. Here is my code so far: // load records list($calendarRecords, $calendarMetaData) = getRecords(array( 'tableName' => 'calendar', 'orderBy' => 'date', )); ----------------------------- <h1>Calendar Of Events</h1> <?php $half=intval($calendarMetaData['totalRecords']/2); $count=0; ?> <table width="300" border="0" cellspacing="0" cellpadding="3"> <tr><td> <?php $heading = ""; ?> <?php foreach ($calendarRecords as $event): ?> <?php if($heading!=date("F, Y",strtotime($event['date']))): ?> <?php $heading=date("F, Y",strtotime($event['date'])); ?> <span class="highlightCaps"><?php echo $heading; ?><br /></span> <?php endif ?> <?php echo date("l, F jS",strtotime($event['date'])); ?><br /> <?php echo $event['location'] ?> | <?php echo $event['time'] ?><br /> <?php echo $event['title']; ?><br /><br /> <?php $count++; ?> <?php endforeach ?></td> </tr> </table> The code above has an attempt to look at the # of records and split it into two columns which I found in a post but that didn't work. I would like to be able to do it by how many months and then split. Any help is appreciated. thanks.
|