Help with PHP and HTML

0

I'm learning php and html and would like some help if possible, of course. I am creating a table according to some variables passed as parameter and when it is created!

I'dliketoremovethesespacesforeachcolumnthatisbeingdisplayedinwhite.Someoneknowshowtosolveit.ThanksinadvanceMycodeismessy,Iconfess,becauseI'mstilllearning,butitfollows:

<!DOCTYPEhtml><html><head><title>BootstrapExample</title><metacharset="utf-8">
<link rel="stylesheet"href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"> 
</script>
</head>
<body>
<div class="container">

 <?php header("Content-type: text/html; charset=utf-8");
 include_once("BDdados.php");
 $idSetorSelecionado = $_POST['setor'];
 $idCompentenciaSelecionado = $_POST['competencia'];
 $qtdeDeRegistro = $_POST['funcionarios'];

 echo "O setor selecionado no combobox foi " . $idSetorSelecionado . "<br>";
 echo "A competencia selecionado no combobox foi " . 
 $idCompentenciaSelecionado . "<br>";
 echo "O numero de funcionarios e " . $qtdeDeRegistro . "<br>";

 $strcon = mysqli_connect($servidor,$usuario,$senha,$banco);
 mysqli_set_charset($strcon, 'utf8'); // Configurar a conexão para usar 
 codificação UTF-8

 if (!$strcon) {
 die('Não foi possível conectar ao MySQL');
 }
 $sqlLookCompetencia = "SELECT nome, qtd_dias FROM competencia WHERE 
 id='$idCompentenciaSelecionado'";
 $resultadoLookCompetencia = mysqli_query($strcon,$sqlLookCompetencia) or 
 die(mysql_error()."<br>Erro ao executar a inserção dos dados");
 $elemento = mysqli_fetch_array($resultadoLookCompetencia);
 $qtdeDeDias = $elemento['qtd_dias'];

$x = 1;
$y = 1; 
echo"<table class='table table-bordered'>";
echo"<thead><tr><td></td><td></td><td></td><td></td><td colspan='2'>HORÁRIO</td><td colspan='2'>HORÁRIO INTRAJORNADA</td></tr></thead>";
echo"<tbody>";
echo"<tr>";
echo"<th scope='col'>MATRÍCULA<th>";
echo"<th scope='col'>NOME COMPLETO<th>";
echo"<th scope='col'>NOME E Nº CONSELHO<th>";
echo"<th scope='col'>SETOR DE LOTAÇÃO<th>";
echo"<th scope='col'>ENTRADA<th>";
echo"<th scope='col'>SAÍDA<th>";
echo"<th scope='col'>ENTRADA<th>";
echo"<th scope='col'>SAÍDA<th>";
while($x <= $qtdeDeDias) {
    echo"<th scope='col'>".$x."<th>";
$x++;
} 
$x = 1;
echo "</tr>";

while($y <= $qtdeDeRegistro) {
    echo"<tr>";
    echo"<th><th>";
    echo"<th><th>";
    echo"<th><th>";
    echo"<th><th>";
    echo"<th><th>";
    echo"<th><th>";
    echo"<th><th>";
    echo"<th><th>";
    while($x <= $qtdeDeDias) {
        echo"<th><th>";
        $x++;
    } 
    $y++;
    $x = 1;
} 
echo"</tr>";
echo"</tbody>";
echo"</table>";


?>
</div>

</body>
</html>
    
asked by anonymous 09.05.2018 / 05:41

1 answer

0

Friend, check the <th> tag because you are not closing it, for example, the line:

echo "<th scope='col'>MATRÍCULA<th>

Notice that you have not closed the tag, just close it:

echo "<th scope='col'>MATRÍCULA</th>

Review your tags <tr> <td> and <th> and see if it's being closed after opening them.

    
09.05.2018 / 14:09