Jump to content

Recommended Posts

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!

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 :

vert.jpg

 

I would like to have it display like this.

horiz.jpg

 

I am a newb.

Thanks

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.