Rails Coder.
Rails Coder.

Reputation: 135

I can't display my database items in rows

I'm trying to display my database items in rows and i can't go forward on with my project.I suppose it's from my stylesheet,but i don't seem to get what's my error.

I have uploaded some pics for a better understanding of my problem.

https://i.sstatic.net/U7FWl.jpg

CSS:

#item {

text-align:center;
border: 5px solid #D9D9D9;
height:10px;
list-style: none;
margin-left: 1.5em;
margin-right: 30px;
 margin-bottom: 40px;
margin-top: 40px;
width: 140px; 
border-radius: 5px;
-moz-border-radius: 10px; /* firefox rounded corners */
-webkit-border-radius: 10px; /* Safari rounded corners */
min-height: 200px;
 }

#item li h1 {
 text-align:center;
  }

#item li#white{
min-height: 10px;
 }

Echoing the products via Model:

   <?php

  include '../controller/produse.php';



  $products=Produse::SelectProducts();

  for ($key_Number = 0; $key_Number < count($products); $key_Number+=2) {

   echo "<div id= 'item'>" .

     "<p><img src=../".$products[$key_Number]." height=\"125\"width=\"110\" ></p>";

    echo $products[$key_Number+1];

    "</div>";
   }

?>

Upvotes: 0

Views: 65

Answers (1)

RappY
RappY

Reputation: 472

<div style="display:table">
<div style="display:table-row">
<div style="display:table-cell">first cell</div></div>

<div style="display:table-row">
<div style="display:table-cell">second cell</div></div>

<div style="display:table-row">
<div style="display:table-cell">third cell</div></div>

<div style="display:table-row">
<div style="display:table-cell">fourth cell</div></div>

</div>

Upvotes: 1

Related Questions