我有这个表,我向表中添加的行越多,表与表上方的文本之间形成的空间就越大。
$qq=mysql_query("SELECT * FROM piatto");
echo "<table border=1>
<tr>
<th>ID</th>
<th>Nome</th>
<th>Descrizione</th>
<th>Tempo</th>``
<th>Prezzo</th>
<th>quantita</th>
</tr>";
while($cicle=mysql_fetch_array($qq)){
echo "<tr>";
echo "<td>". $cicle['id']."</td>";
echo "<td>". $cicle['titolo']."</td>";
echo "<td>". $cicle['descrizione']."</td>";
echo "<td>". $cicle['tempo_preparazione']."</td>";
echo "<td>". $cicle['prezzo']."</td>";
echo "<td>". $cicle['quantita']."</td>";
echo "</tr>";
echo "<br />";
}
echo "</table>" ;
echo"<br />";`enter code here`
我该如何解决这个问题?
表内<br />
的原因是什么?由于它没有封装在<td>
中,因此它不会作为表的一部分包含,而是实际显示在表的上方。由于<br />
是你的while循环的一部分,你有更多的行,你将有更多的休息,你将有以上的表。
如果你想增加行与行之间的间距,要么使用CSS,要么只包含一个空的表行。