【问题标题】:How to print Table of this format [closed]如何打印这种格式的表格[关闭]
【发布时间】:2015-06-09 09:45:08
【问题描述】:

我在mysql中有以下数据,我想以这种格式回显:

数据:

名称、图片网址、链接

我想像这样动态打印它:http://screensaver.cf/screensavers.php

我不知道用户的屏幕宽度,我仍然希望它尽可能地显示宽度。

如何在 html 和 PHP 中做到这一点?

我的代码:

<?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 我知道 mysql 已经贬值了,我一直在努力学习 mysqli,因为我在 8th class,所以我没有太多时间。

【问题讨论】:

    标签: php html mysql


    【解决方案1】:

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

    【讨论】:

    • 谢谢,但我已经开始了!
    猜你喜欢
    • 2015-08-17
    • 1970-01-01
    • 1970-01-01
    • 2022-07-11
    • 2015-09-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-27
    相关资源
    最近更新 更多