I have the following code in head
to give a better appearance to my table but some reason does not work, the table stays like this, what can it be?
<head>
<meta charset="UTF-8">
<title>
Tabla PHP
</title>
<script type="text/javascript" src="jquery-1.11.2.js"></script>
<link rel="stylesheet" type="text/css"
href="//cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css">
<script type="text/javascript"
src="//cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"> </script>
<script type="text/javascript">
$(document).ready( function ()
{
$('#tabla1').DataTable();
} );
</script>
</head>
<?php
require("coneccion/conexion.php");
print("Coneccion exitosa </br>");
$tablacontenido=''; $tabla = "CALL TraerTodos();"; $r= mysqli_query($l, $tabla); if ($r) { while ($reg = mysqli_fetch_object($r)) {
$tablacontenido= $tablacontenido.'<tr>'.
'<td>'. $reg->nombre.'</td>'
.'<td>'. $reg->apellido.'</td>'
.'<td>'. $reg->usuario.'</td>'
.'<td>'. $reg->clave.'</td>';
}
}
else
{
print "Error en la operacion de tabla </br>";
}
?>
<table id="tabla1">
<thead>
<tr>
<td>Nombre</td>
<td>Apellido</td>
<td>Nombre de Usuario</td>
<td>Contraseña</td>
</tr>
</thead>
<?php
echo "$tablacontenido";
?>