Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP代码中的HTML表相互重叠_Php_Html_Css - Fatal编程技术网

PHP代码中的HTML表相互重叠

PHP代码中的HTML表相互重叠,php,html,css,Php,Html,Css,我有两个表,分别是要执行的任务和已完成的任务。我不知道为什么当我将新任务添加到“待办任务”表时,该表会变大,并开始与“已完成任务”表重叠。我确实设置了桌子的最大宽度来阻止它,但它没有帮助。有人能教我怎么修吗?多谢各位 $displayQuery="SELECT * FROM incomplete where owner=:owner"; $displayTask= $conn->prepare($displayQuery); $displayTask->bindV

我有两个表,分别是要执行的任务和已完成的任务。我不知道为什么当我将新任务添加到“待办任务”表时,该表会变大,并开始与“已完成任务”表重叠。我确实设置了桌子的最大宽度来阻止它,但它没有帮助。有人能教我怎么修吗?多谢各位

$displayQuery="SELECT * FROM incomplete where owner=:owner";
$displayTask= $conn->prepare($displayQuery);
$displayTask->bindValue(':owner', $owner);
$displayTask->execute();
$allTask=$displayTask->fetchAll();
echo "<table  class=\"incomplete_table\"><caption>To-do Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTask) > 0)
{
    foreach ($allTask as $row) {
        echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a 
              href='delete.php?table=todotask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a 
              href='checkcomplete.php?table=todotask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a 
              href='modify.php?table=todotask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
    }
}

$displayQueryComplete="SELECT * FROM complete where owner=:owner";
$displayTaskComplete= $conn->prepare($displayQueryComplete);
$displayTaskComplete->bindValue(':owner', $owner);
$displayTaskComplete->execute();
$allTaskComplete= $displayTaskComplete->fetchAll();
echo "<table  class=\"complete_table\"><caption>Completed Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTaskComplete) > 0)
{
    foreach ($allTaskComplete as $row) {
        echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a 
        href='delete.php?table=completedtask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a 
        href='checkcomplete.php?table=completedtask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a 
        href='modify.php?table=completedtask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
    }
}

CSS:

.complete_table{
    border: 4px solid #5e001f;
    border-collapse: collapse;
    position: absolute;
    top: 34%;
    right: 1%;
    width: 600px;
    max-width: 600px;
}
.complete_table caption, .incomplete_table caption{
  font-size: 17px;
  color: #5e001f;
  font-weight: bold;
  border: 1px solid #5e001f;
  border-radius: 7px;
  padding: 7px;
  background-color: white;
  margin: 7px;
}
.complete_table th{
  border: 1px solid #5e001f;
  color: #5e001f;
  padding: 7px;
}
.complete_table td{
  border: 1px solid #5e001f;
  padding: 7px;
  color: #5e001f;
}
.incomplete_table{
    border: 4px solid #5e001f;
    border-collapse: collapse;
    position: absolute;
    top: 34%;
    left: 1%;
    width: 600px;
    max-width: 600px;

}
.incomplete_table th{
  border: 1px solid #5e001f;
  color: #5e001f;
  padding: 7px;
}
.incomplete_table td{
  border: 1px solid #5e001f;
  padding: 7px;
  color: #5e001f;
}
.incomplete_table a, .complete_table a{
  text-decoration: none;
  color: #5e001f;
}
.incomplete_table button, .complete_table button{
  width: 76px;
  background-color: white;
  font-size: 14px;
  font-weight: bold;
  border: 1px solid #5e001f;
  border-radius: 7px;
}
试试这个:

$displayQuery="SELECT * FROM incomplete where owner=:owner";
$displayTask= $conn->prepare($displayQuery);
$displayTask->bindValue(':owner', $owner);
$displayTask->execute();
$allTask=$displayTask->fetchAll();
echo "<table  class=\"incomplete_table\"><caption>To-do Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTask) > 0)
{
    foreach ($allTask as $row) {
        echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a 
              href='delete.php?table=todotask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a 
              href='checkcomplete.php?table=todotask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a 
              href='modify.php?table=todotask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
    }
}

echo "</table>";

$displayQueryComplete="SELECT * FROM complete where owner=:owner";
$displayTaskComplete= $conn->prepare($displayQueryComplete);
$displayTaskComplete->bindValue(':owner', $owner);
$displayTaskComplete->execute();
$allTaskComplete= $displayTaskComplete->fetchAll();
echo "<table  class=\"complete_table\"><caption>Completed Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTaskComplete) > 0)
{
    foreach ($allTaskComplete as $row) {
        echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a 
        href='delete.php?table=completedtask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a 
        href='checkcomplete.php?table=completedtask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a 
        href='modify.php?table=completedtask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
    }
}

echo "</table>";
试试这个:

$displayQuery="SELECT * FROM incomplete where owner=:owner";
$displayTask= $conn->prepare($displayQuery);
$displayTask->bindValue(':owner', $owner);
$displayTask->execute();
$allTask=$displayTask->fetchAll();
echo "<table  class=\"incomplete_table\"><caption>To-do Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTask) > 0)
{
    foreach ($allTask as $row) {
        echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a 
              href='delete.php?table=todotask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a 
              href='checkcomplete.php?table=todotask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a 
              href='modify.php?table=todotask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
    }
}

echo "</table>";

$displayQueryComplete="SELECT * FROM complete where owner=:owner";
$displayTaskComplete= $conn->prepare($displayQueryComplete);
$displayTaskComplete->bindValue(':owner', $owner);
$displayTaskComplete->execute();
$allTaskComplete= $displayTaskComplete->fetchAll();
echo "<table  class=\"complete_table\"><caption>Completed Tasks</caption><tr><th>ID</th><th>Title</th><th>Description</th><th>Due Date</th><th>Time</th><th colspan='3'>Button</th></tr>";
if(count($allTaskComplete) > 0)
{
    foreach ($allTaskComplete as $row) {
        echo "<tr><td>".$row["id"]."</td><td>".$row["title"]."</td><td>".$row["description"]."</td><td>".$row["due_date"]."</td><td>".$row["time"]."</td><td><button><a 
        href='delete.php?table=completedtask&did=".$row["id"]."'>Delete</a></button></td>"."<td><button><a 
        href='checkcomplete.php?table=completedtask&did=".$row["id"]."'>Complete</a></button></td>"."<td><button><a 
        href='modify.php?table=completedtask&did=".$row["id"]."'>Modify</a></button></td>"."</td></tr>";
    }
}

echo "</table>";

您没有关闭标记您没有关闭标记问题没有解决您可以将开发人员工具中的所有html粘贴到浏览器中吗?或者提供指向网站的链接问题没有解决您可以将开发人员工具中的所有html粘贴到浏览器中吗?或提供网站链接