Hello this is my code and although I put the rowspan to 3 does not generate the table correctly, I try to generate a table from a two-dimensional array with PHP but when formatting the table does not come out as it should, I can not find the error, please help.
<table border="1">
<?php
//Primero creamos dos arrays $matriz_pablo y $matriz_roberto para luego insertarlas en un array general $matriz_general la que sera bidimensional
$matriz_pablo = array('nombre' => 'pablo', 'profesion' => 'ministro', 'edad' => '50');
$matriz_roberto = array('nombre' => 'roberto', 'profesion' => 'agricultor', 'edad' => '45');
$matriz_general = array('PABLO' => $matriz_pablo,'ROBERTO' => $matriz_roberto);
//A continuación imprimimos los valores de la matriz bidimensional.
//El Primer FOREACH muestra las claves de primer nivel PABLO y ROBERTO
foreach ($matriz_general as $key => $value) {
echo "<tr>"."<td rowspan='3'>".$key."</td>";//Se muetra la Clave
//El Segundo FOREACH mostrará las claves y valores de segundo nivel internos de la columna valor de primer nivel.
foreach ($value as $clave => $valor) {
echo "<tr>"."<td>".$clave."</td>"."<td>".$valor."</td>"."</tr>";
}
echo "</tr>";
}
?>
</table>