表格显示向下,我需要从左到右

时间:2015-03-27 11:16:39

标签: php

 <?php 
      include("config.php");
      $sql="SELECT * from product_tbl where prod_status=1 order by prod_id desc LIMIT 6";
      $result=mysql_query($sql);
      while ($row=mysql_fetch_assoc($result)) {
        echo "<table class='products' border=1 width=180>";
        echo "<tr><td>";
        echo "<center>";
        echo $row['prod_name'];
        echo "</center>";
        echo "</td></tr>";
        echo "<tr><td>";
        echo "<img src='".$row['prod_img']."' height=200 width=178/>";
        echo "</td></tr>";
        echo "<tr><td>";
        echo "<center>";
        echo "Rs.".$row['prod_price'];
        echo "</center>";
        echo "</td></tr>";
        echo "</table>";
      }

1 个答案:

答案 0 :(得分:1)

您使用td尝试float:left样式,或者您需要在行中尝试tr样式float :left