php - 在 php - 语法的结果周围画一个框

标签 php html mysql

我正在尝试使用 php 从 mysql 数据库创建一个结果页面,将每行结果(包含图像和其他一些详细信息行)封装在一个框中。

目前,page.php 从数据库中获取数据,并使用 result.inc 将数据格式化为每行三个单元格的信息行。

Address1   Picture    Comment
Address2   Picture2   Comment2
etc.

我想把每一行都装在漂亮的盒子里(甚至只是一个盒子)。这会在表格前产生一个空的(但有边框的)框,然后是正常的表格。

如何关闭装有结果的盒子?

<style>
    p {
        outline-style: solid;
        outline-width: 5px;
    }
</style>

for($i=1; $i <= $num_rows; $i++) {
    $row = mysql_fetch_array($result);
    print("<p>");
    print("<TR>");
    include("includes/result.inc");
    print("</TR>");
    print("</p>");
}

最佳答案

您不能只在表格行之间放置 p 标签。相反,为表格行设置样式:

<style>
    tr {
        outline-style: solid;
        outline-width: 5px;
    }
</style>

还有 php:

for($i=1; $i <= $num_rows; $i++) {
    $row = mysql_fetch_array($result);
    print("<TR>");
    include("includes/result.inc");
    print("</TR>");
}

关于php - 在 php - 语法的结果周围画一个框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32272379/

相关文章:

php - Joomla 3.0 的 db->loadObjectList() 可能存在问题

PHP strtr 根本不起作用

javascript - 是什么导致 SyntaxError : Unexpected EOF error in underscore template?

mysql - 在 ASP.net (vb.net) 中使用参数将数据插入 MySqlDatabase 时出现问题

PHP 在外部 html 文件中显示搜索结果文本文件

php - 需要 html 复选框被 mysql 结果选中

jquery - 在一天中的某些时间自动用 json 更新 html

html - 如果可能的话,如何制作透明背景及其背后的元素?

C# 通过用户控制连接mysql

mysql - sql查询合并列