我正在尝试使用 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/