He recurrido a un código que he encontrado en internet
link: https://www.youtube.com/watch?v=FucYLYJ1D4M
Lo he adaptado a mi base de datos Mysql y funciona.
El problema es que no puedo dimensionar la anchura de la tabla.
El código es:
Código PHP:
Código PHP:
Ver original
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Solicitudes</title> </head> <body> <?php include("conexion.php"); echo "<table border=1> <tr> <th>IdServ</th> <th>Ref_Pres</th> <th>Ref_Serv</th> <th>Tiempo</th> <th>Usuarios</th> <th>HoraI</th> <th>HoraII</th> <th>Reserva</th> <th>Precio</th> <th>Coste</th> <th>Sumprecio</th> <th>Sumcoste</th> <th>Acron</th> </tr>"; echo "<form action=form_solicitudes.php method=post>"; echo "<tr>"; echo "<td>" . "<input type=text class= 'min' name=txtIdpres_Serv value=" . $record['Idpres_Serv'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtRef_Pres value=" . $record['Ref_Pres'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtRef_Serv value=" . $record['Ref_Serv'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtTiempo value=" . $record['Tiempo'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtUsuarios value=" . $record['Usuarios'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtHoraI value=" . $record['HoraI'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtHoraII value=" . $record['HoraII'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtReserva value=" . $record['Reserva'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtPrecio value=" . $record['Precio'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtCoste value=" . $record['Coste'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtSumprecio value=" . $record['Sumprecio'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtSumcoste value=" . $record['Sumcoste'] . " </td>"; echo "<td>" . "<input type=text class= 'min' name=txtAcron value=" . $record['Acron'] . " </td>"; echo "<td>" . "<input type=hidden name=hidden value=" . $record['Idpres_Serv'] . " </td>"; echo "<td>" . "<input type=submit name=update value=update" . " </td>"; echo "<td>" . "<input type=submit name=delete value=delete" . " </td>"; echo "</tr>"; echo "</form>"; } echo "<form action=solicitudes.php method=post>"; echo "<tr>"; echo "<td><input type=text class= 'min' name=txtIdpres_Serv></td>"; echo "<td><input type=text class= 'min' name=txtRef_Pres></td>"; echo "<td><input type=text class= 'min' name=txtRef_Serv></td>"; echo "<td><input type=text class= 'min' name=txtTiempo></td>"; echo "<td><input type=text class= 'min' name=txtUsuarios></td>"; echo "<td><input type=text class= 'min' name=txtHoraI></td>"; echo "<td><input type=text class= 'min' name=txtHoraII></td>"; echo "<td><input type=text class= 'min' name=txtReserva></td>"; echo "<td><input type=text class= 'min' name=txtPrecio></td>"; echo "<td><input type=text class= 'min' name=txtCoste></td>"; echo "<td><input type=text class= 'min' name=txtSumprecio></td>"; echo "<td><input type=text class= 'min' name=txtSumcoste></td>"; echo "<td><input type=text class= 'min' name=txtAcron></td>"; echo "<td>" . "<input type=submit name=add value=add" . " </td>"; echo "</form>"; echo "</table>"; ?> </body> </html>
La linea 11 inicia la tabla.
He usado:
Código PHP:
Código PHP:
Ver original
echo <table border=1 width=50%>
Código PHP:
Ver original
echo <table border=1 width=500>
Código PHP:
Ver original
echo <table border=1 width=500px>
Código PHP:
Ver original
echo <table border=1 width='500px'>
Código PHP:
Ver original
echo <table border=1 width="500px">
y así sucesivamente.
Espero que alguien sepa como puedo hacerlo y la explicación de qué hago mal.
Gracias