You are here:  » Horizontal Array


Horizontal Array

Submitted by ukdave on Mon, 2006-09-11 23:21 in

Hi,
I've had no problem placing data feed record results into a table, the "myrecordhandler" function then seems to makes a stack or verticle array of tables each containing the next record in order. This is fine but I also need a way to print out records horizontally, one after the other within a single table.

Something like this:

My horizontal aray:
record1, record2, record3, record4, record5

Is this possible please?

Submitted by support on Tue, 2006-09-12 06:56

Hi Dave,

That shouldn't be a problem - just start and end your table outside of the myRecordHandler function, and then make sure that you display the appropriate TD tags when displaying each record. For example:

<?php
  
function myRecordHandler($record)
  {
    print 
"<td>";
    
// display contents of $record as required
    
print "</td>";
  }
  
// start the table and the first row
  
print "<table>";
  print 
"<tr>";
  
// parse the feed to create the cells
  
MagicParser_parse( ... );
  
// end the table
  
print "</tr>";
  print 
"</table>";
?>

Cheers,
David.

Submitted by ukdave on Tue, 2006-09-12 10:10

Hi David,
You make it all seem so easy, thanks!