How can I leave empty cells in a table if I do not want anything to appear in that field? I am sending to call names of some subjects registered in my database, I send them to call and bring them to me there is no problem, the problem is when in a cell if it does not fulfill the condition that I am telling you to leave the field in white and put in the corresponding field, EXAMPLE:
In the Monday field it is supposed to be blank, since there is no class in that schedule, and the Wednesday field also has to be blank, but they do not fit in.
I leave here the code:
<body>
<?php require 'views/navbar.php'; ?>
<div class="contenedor">
<h2>Horario de clases</h2>
<table>
<thead>
<tr>
<th>HORA</th>
<th>LUNES</th>
<th>MARTES</th>
<th>MIERCOLES</th>
<th>JUEVES</th>
<th>VIERNES</th>
</tr>
</thead>
<tr>
<td>8:00 - 9:00</td>
<?php foreach($datos = $conexion->query('SELECT * FROM horario WHERE hora = 8') as $dato){ ?>
<td><?php if(empty($dato)){
echo "Disponible";
}else{
echo $dato ['materia'];
} ?>
</td>
<?php } ?>
</tr>
<tr>
<td>9:00 - 10:00</td>
</tr>
<tr>
<td>10:00 - 11:00</td>
</tr>
<tr>
<td>11:00 - 12:00</td>
</tr>
<tr>
<td>12:00 - 13:00</td>
</tr>
</table>
</div>
Any idea how I can do it? Thanks
Fields in my time table:
Send me this error: