帮助,我真的厌倦了在我的结果页面中使用这些大量的nbsps。我只是一个初学者。你可以向我推荐一些技巧,这样我就不会复制粘贴这么多,只是为了得到我需要的空间和换行符。
while($row = mysql_fetch_array($result))
{
echo "Patient #:". " ". " ". " ". " ". $row['PNUM'];
echo "<B>"."Hospital #:"."</B>". " ". " ". " ". " ". $row['HOSPNUM']." "." "." ";
echo "<B>"."Room:". " ". " ". " ". " ". $row['ROOMNUM'];
echo "<B>"."Lastname:". " ". " ". " ". " ". $row['LASTNAME'];
echo "<B>"."Firstname:". " ". " ". " ". " ". $row['FIRSTNAME'];
echo "<B>"."Middlename:". " ". " ". " ". " ". $row['MIDNAME'];
echo "<B>"."Admission Date:". " ". " ". " ". " ". $row['ADATE'];
echo "<B>"."Admission Time:". " ". " ". " ". " ". $row['ADTIME'];
echo "<B>"."Patient #:". " ". " ". " ". " ". $row['PNUM'];
}
答案 0 :(得分:9)
使用HTML table代码。
答案 1 :(得分:5)
是否必须是纯文字,还是可以在table?
中显示<table>
<tr>
<th>Patient #</th>
<th>Hospital #</th>
<th>Room</th>
<!-- etc. -->
</tr>
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>$row['PNUM']</td>";
echo "<td>$row['HOSPNUM']</td>";
echo "<td>$row['ROOMNUM']</td>";
// etc.
echo "</tr>";
}
</table>
答案 2 :(得分:4)
考虑表格或定义列表
答案 3 :(得分:1)
如果您的输出主要用于调试,则可以在pre
代码,预代码,预服务空间和换行符输出结果
如果没有,你应该学习一些html(和css),一些可能性是列表,表格或css风格的自定义标记