javascript - 从左到右显示图像php

标签 javascript php html mysql css

<table>
        <tr>
            <th>image</th>
        </tr>
            <?php 
                $query = "SELECT * FROM collage";
                $result = mysqli_query($con, $query);
                while($row = mysqli_fetch_array($result))
                {
                ?>
                    <tr>
                        <td><a href="img/collage/<?php echo $row['file'] ?>" target="_blank"><img src="img/collage/<?php echo $row['file'] ?>"></a></td>
                    </tr>
                <?php
                }
                ?>
    </table>

你好天才程序员! 我上面的代码显示这样的图像:

enter image description here

我希望它变成这样: enter image description here

最佳答案

设置<tr></tr>来自 <?php ?>

试试这个

<table>
    <tr>
        <th>image</th>
    </tr>
     <tr>
        <?php 
            $query = "SELECT * FROM collage";
            $result = mysqli_query($con, $query);
            while($row = mysqli_fetch_array($result))
            {
            ?>

                    <td><a href="img/collage/<?php echo $row['file'] ?>" target="_blank"><img src="img/collage/<?php echo $row['file'] ?>"></a></td>

            <?php
            }
            ?>
    </tr>
</table>

关于javascript - 从左到右显示图像php,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39611809/

相关文章:

javascript - 当类名相同时单击事件不起作用

javascript - 如何在可见时启动文本 svg-animation?

html - CSS填充父可用空间

php - 谷歌图表 API : Display Data Points (PHP + MySQL)

php - Zend MySQL 检查表是否存在

javascript - 从 XML 文件调用某些元素?

javascript - HTML格式的YouTube视频不起作用

javascript - Angular2 不遍历模型数组

javascript - "animate-delay: 1s;"还在进行时隐藏div,延时后显示

php - 当我在 PrestaShop 上创建产品时添加类别