Un ejemplo:
Código PHP:
echo "<table>";
$result = mysql_query ("SELECT * FROM detalle WHERE IdPedido LIKE '$IdPedido'");
$numeroRegistros=mysql_num_rows($result);
while($r=mysql_fetch_array($result))
{
$IdDetallePedido=$r["IdDetallePedido"];
$IdProducto=$r["IdProducto"];
$Cantidad=$r["Cantidad"];
// aquí deberías hacer tu echo ..
echo "<tr>"; // inicio "fila"
echo "<td>".$IdProducto."</td>"; // celda1
echo "<td>".$cantidad."</td>"; // celda2
echo "</tr>\n; // fin "fila"
}
echo "</table>";
Pero .. si usas un editor visual tipo "Dreamweaver" por ejemplo .. podrias hacer algo tipo:
Código PHP:
<table width="75%" border="1">
<?
$result = mysql_query ("SELECT * FROM detalle WHERE IdPedido LIKE '$IdPedido'");
$numeroRegistros=mysql_num_rows($result);
while($r=mysql_fetch_array($result)) {
?>
<tr>
<td><? echo $IdProducto?></td>
<td><? echo $cantidad ?></td>
</tr>
<?
}
?>
</table>
Así lo veras de forma "visual" como queda tu tabla y la podrías diseñar mejor ..
Un saludo,