Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8156269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:53:57+00:00 2026-06-06T16:53:57+00:00

I am working on a very simple webshop, it should echo different products in

  • 0

I am working on a very simple webshop, it should echo different products in a table of 2 <td> by 4 <tr> but now it only displays the different products downwards. Hopefully someone here can help me.

$result=mysql_query("select * from products");
while($row=mysql_fetch_array($result)) {

    $artikel = '<div style="background-color:#E3E3E3;width:200px;height:200px;"><a href=""><img style="padding-top:10px;padding-left:25px;width:150px;height:150px;" src="'.htmlspecialchars($row['picture']).'"></a><br><div align="center"><b>'.htmlspecialchars($row['name']).'</b><br><h6>&euro;'.htmlspecialchars($row['price']).'</h6></div></div>';

    echo '<table><tr><td>'.$artikel.'</td>';
    echo '</table>';
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T16:53:59+00:00Added an answer on June 6, 2026 at 4:53 pm

    Why would it display a table of 2 by 4?

    You are putting every product in its own table, so the first thing to do, is move the table tags out of the loop and then you need to add logic to add a new row after every x products.

    Although you don’t seem to need a table as your div has fixed dimensions, so you can just get rid of the table and use css to get the grid you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a very simple DotNetOpenAuth implementation working for my MVC4 site (Google only).
This is a very simple, (hopefully) question. I am new to working with DateTime
Its very simple but somehow not working (weird!!). I have a List of a
I am working on a very simple script but for some reason parts of
Actually I'm working on very simple FTP server. Now I have problem with sending
I'm working on a very simple game (essentially an ice sliding puzzle), for now
I'm working on a very simple flash but having problem compiling to the swf
I've been working on a very simple Jquery script that displays a few mini-dashboards
I am trying to get jscrollpane working on a very simple page, but for
I am working on a very simple stopwatch using WPF but using the System.Diagnostics

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.