Jump to content

Recommended Posts

For that kind of layout you would be better using CSS. I don't think that you can nest tables within table cells (never tried)  so I don't see you getting the layout that you are looking for without CSS.

 

if you just want to use your current table and add another product listing on the same row change the contents of the while loop to include an if statement that will check and set a second product on the same row before droping down to the next we can use that little $i variable that's just hanging about at the top of the loop:

$i = 0;
        echo = "<table><tr>";
        while ($row = mysql_fetch_array($result_set))
        {
           echo"<td>{$row['product_id']}</td><td>{$row['product_title']}</td><td>{$row['product_Description']}</td><td>{$row['product_price']}</td>";
           if ($i >= 1){echo "</tr><tr>"; $i = 0;}else{$i = $i++;}
        }
        echo "</tr></table>";

Link to comment
https://forums.phpfreaks.com/topic/248573-unexpected/page/2/#findComment-1278680
Share on other sites

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.