![](/img/trans.png)
[英]Why is there a small gap between an absolutely positioned child and parent with borders? All margins, padding, and positions are set to 0
[英]Borders Positions
CSS:
table.tftable {
font-size:12px;
color:#333333;
width:50%;
border-width: 1px;
border-color: #729ea5;
border-collapse: collapse;
}
table.tftable th {
font-size:12px;
background-color:#acc8cc;
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #729ea5;
text-align:left;
}
table.tftable tr {
background-color:#d4e3e5;
}
table.tftable td {
font-size:12px;
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #729ea5;
}
PHP:
<?php
$queryOtherEvents = "select * from `eventos` where `data` > '$data'";
$resultOtherEvents = mysql_query($queryOtherEvents);
while($row = mysql_fetch_array($resultOtherEvents)) {
$nome = $row['nome'];
$data = $row['data'];
$url = $row['descricao'];
echo "<table id=tfhover class=tftable border=1>";
echo "<tr><th>$data</th><th><a href=$url>$nome</a></th></tr>";
echo "</table>";
}
?>
我在表中显示了一个事件的日期和事件的名称,但是如果事件的名称大于1st,则边框的位置会切换...,如何在下图中看到:
我认为您的问题是您要为每一行插入一个表。 您应该使用一个表,并为数据库中的每一行在表中添加一行。
尝试这个
<?php
$queryOtherEvents = "select * from `eventos` where `data` > '$data'";
$resultOtherEvents = mysql_query($queryOtherEvents);
echo "<table id=tfhover class=tftable border=1>";
while($row = mysql_fetch_array($resultOtherEvents)) {
$nome = $row['nome'];
$data = $row['data'];
$url = $row['descricao'];
echo "<tr><th>$data</th><th><a href=$url>$nome</a></th></tr>";
}
echo "</table>";
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.