gpt4 book ai didi

html - 边框位置

转载 作者:太空宇宙 更新时间:2023-11-03 18:09:21 25 4
gpt4 key购买 nike

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>";
}
?>

我在表格中显示事件的日期和事件的名称,但是如果事件的名称大于第一个,则边框的位置会切换...,您如何在下图中看到:

enter image description here

最佳答案

我认为您的问题是您要为每一行插入一个表。您应该使用一个表,并为数据库中的每一行向表中添加一行。

试试这个

   <?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>";

?>

关于html - 边框位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24041016/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com