0
我有3列來自mysql數據庫的結果。這些列有正確的信息,但是列數據都是一起碾壓的,你可以在http://althedge.xyz/index2.html看到我對HTML很少了解,並試圖讓列在頁面上均勻分佈。任何人都可以告訴我如何做到這一點?由於Mysql數據庫 - 需要3列等於
下面是代碼:
<?php
// Database Settings
define('DB_HOST', 'localhost');
define('DB_PORT', '3306');
define('DB_USER', '*****');
define('DB_PASS', '*****');
define('DB_NAME', '*****');
// Connection to Database
$database = new MySQLi(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);
$sql = 'SELECT * '
. ' FROM posts';
$resultSet = $database->query($sql);
// Begin building some HTML output
$html = '<table border="0">
<tr>
<th>Column1</th>
<th>Column2</th>
<th>Column3</th>
</tr>';
while ($row = $resultSet->fetch_assoc())
{
$html .= '<tr>';
$html .= '<td>' . $row['Column1'] . '</td>';
$html .= '<td>' . $row['Column2'] . '</td>';
$html .= '<td>' . $row['Column3'] . '</td>';
$html .= '</tr>';
}
$html .= '</table>';
echo $html;
?>
我可以發誓,我看到貼1-2小時,前一個問題非常相似,這一切列。 –