Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.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 重复表格标题_Php_Html_Database - Fatal编程技术网

Php 重复表格标题

Php 重复表格标题,php,html,database,Php,Html,Database,我制作了一个在html表格中显示数据库信息的表格。每行的表头都会重复。是否有办法使标题仅显示在表格顶部 <table class="table"> <tr> <th>ID</th> <th>Login-ID</th> <th>Konto typ</th> <th>Lösenord</th> <

我制作了一个在html表格中显示数据库信息的表格。每行的表头都会重复。是否有办法使标题仅显示在表格顶部

      <table class="table">
    <tr>
      <th>ID</th>
      <th>Login-ID</th>
      <th>Konto typ</th>
      <th>Lösenord</th>
      <th>Skapad</th>
    </tr>
<tr>
<td>' . $row['ID']. '</td>
<td>' . $row['user_id']. '</td>
<td>' . $row['user_type']. '</td>
<td>' . $row['user_pwd']. '</td>
<td>' . $row['user_created']. '</td>
    </tr>
  </table>
</div>

身份证件
登录标识
Konto型
罗森诺德
斯卡帕德
' . $行['ID']。'
' . $行['user_id']。'
' . $行['user_type']。'
' . $行['user_pwd']。'
' . $行['user_created'].'
不应位于循环内

echo '<div>
        <table>
        <tr>
          <th>ID</th>
          <th>Login-ID</th>
          <th>Konto typ</th>
          <th>Lösenord</th>
          <th>Skapad</th>
        </tr>
    ';
foreach ($rows as $row) {
    echo '<tr>
            <td>' . $row['ID']. '</td>
            <td>' . $row['user_id']. '</td>
            <td>' . $row['user_type']. '</td>
            <td>' . $row['user_pwd']. '</td>
            <td>' . $row['user_created']. '</td>
        </tr>
        ';
}
echo '</table>
    </div>';
echo'
身份证件
登录标识
Konto型
罗森诺德
斯卡帕德
';
foreach($行作为$行){
回声'
“.$row['ID']”
“.$row['user_id']”
“.$row['user_type']”
“.$row['user_pwd']”
“.$row['user_created']”
';
}
回声'
';

您能用从数据库中获取数据的部分更新您的问题吗?它似乎在一个循环中。请显示完整的代码。循环应该只围绕
,而不是围绕
。现在我们只希望它停在那里;-)哦,你这里少了一些分号。我知道我可以编辑,但你必须为我给你的那十英镑工作;-)编辑:格雷齐@FunkFortyNiner哇,过去几天你真的让我筋疲力尽了。:)我几乎以
的风格重做了一遍。是的,这是一次很好的重做,但这让他们走出了困境:)编辑:我们只希望他们不会遇到大灰狼!