dskzap8756
dskzap8756
2015-04-04 13:10

如何打印此格式的表格[关闭]

已采纳

I have following data in mysql, and I want to echo in this format:

Data:

Name,Image URL,Link

I want to print it dynamically like this : http://screensaver.cf/screensavers.php

I don't know user's screen width, still I want it to appear as much as possible in width.

How can I do this in html and PHP?

My code:

<?php
    require("config.php");
?>   

<div id="main-wrap">
    <div class="container">
        <div id="main">
            <div id="content"><div id='wsite-content' class='wsite-elements wsite-not-footer'>
<div class="paragraph" style="text-align:left;">
<?php

    $sql='SELECT * FROM `games` where 1=1';

    $data = mysql_query($sql);
    echo '<h4 class="result">Result:</h4>';

    while($row = mysql_fetch_row($data)){

       $table=WHAT TO DO HERE TO MAKE IT LOOK LIKE THAT???????
       echo $table;
       echo '<br><br>';
    }
?>
</div>
</div>
        </div>
    </div>
</div>

<?php
    include("footer.php");
?>

P.S I know mysql is depreciated and I am constantly working to learn Mysqli, as I am in 8th class, I don't have much time.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • douxia3505 douxia3505 6年前

    <style>.a{float:left;}
    </style>
    > 
    in while loop use this
    
    <div class = "a"> 
    <?php  <img src='".$row['url']."' width='140' height='140'> ?>
    </div>

    </div>
    
    点赞 评论 复制链接分享

为你推荐