私は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;
?>
を使用することができます間隔。 –