在屏幕中心顯示此表格時出現問題。請指教?在屏幕中央顯示HTML表格
該網站鏈接粘貼下面:
http://www.technicaldebt.co.uk/fyp/prototype/databasetest.php
任何幫助是極大的讚賞。
<table border="5" cellspacing="2" cellpadding="2">
<tr>
<td><font face="Arial, Helvetica, sans-serif">Title</font></td>
<td><font face="Arial, Helvetica, sans-serif">First Name</font></td>
<td><font face="Arial, Helvetica, sans-serif">Last Name</font></td>
<td><font face="Arial, Helvetica, sans-serif">E-mail Address</font></td>
<td><font face="Arial, Helvetica, sans-serif">Project Title</font></td>
</tr>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"Titles");
$f2=mysql_result($result,$i,"FirstName");
$f3=mysql_result($result,$i,"LastName");
$f4=mysql_result($result,$i,"Email");
$f5=mysql_result($result,$i,"ProjectRoles");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td>
</tr>
<?php
$i++;
}
?>
可能重複http://stackoverflow.com/questions/301147/css-way-to-horizontally-align-table – Liam 2013-03-13 17:27:13
我不知道如果這是一個錯字或沒有,但你錯過了你標記,這可能會弄亂你的渲染。 – 2013-03-13 17:28:25
你應該發佈生成的html,因爲這與php無關。 – jeroen 2013-03-13 17:29:22