stitchlips Posted May 28, 2009 Share Posted May 28, 2009 Can someone point me int right direction. I have an xml document that I am parsing using simplexml. I can loop through my results and display them vertically in a table but I would like to display the data horizontally in columns. I looked here http://www.phpfreaks.com/forums/index.php/topic,95426.0.html I am not sure if that is what I need or not. Thanks! Link to comment https://forums.phpfreaks.com/topic/160038-parse-xml-with-php-and-display-in-columns/ Share on other sites More sharing options...
JonnoTheDev Posted May 28, 2009 Share Posted May 28, 2009 post your loop and how you want it displayed Link to comment https://forums.phpfreaks.com/topic/160038-parse-xml-with-php-and-display-in-columns/#findComment-844308 Share on other sites More sharing options...
stitchlips Posted May 28, 2009 Author Share Posted May 28, 2009 Here is my current code <?php $request_url = "exampl_url"; $xml = simplexml_load_file($request_url) or die("Something Wierd just happened, try refreshing your browser or come back in a minute or so."); ;?> <?php foreach($xml->SearchResult->ItemArray->Item as $Item){ $title = $Item->Title ; $price = $Item->Price ; ?> <table width="64%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><?php echo $title; ?></font></a></td> <td><span class="leftmenucopy"><font color="#FF0000"><?php echo $price; ?></font></span></td> </tr> </table> <?php } ?> It displays like this : I would like to have it display like this. I am a newb. Thanks Link to comment https://forums.phpfreaks.com/topic/160038-parse-xml-with-php-and-display-in-columns/#findComment-844334 Share on other sites More sharing options...
JonnoTheDev Posted May 28, 2009 Share Posted May 28, 2009 Same principle http://www.codewalkers.com/c/a/Database-Articles/Multicolumn-Output-from-a-Database-with-PHP/ Link to comment https://forums.phpfreaks.com/topic/160038-parse-xml-with-php-and-display-in-columns/#findComment-844501 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.