【发布时间】:2021-08-28 02:51:52
【问题描述】:
我正在尝试将 SQL 查询的结果放入一个表中,并且每次有一个新的结果来创建一个新的表数据框。我的代码看起来像
<html>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
</style>
<?php
<table style="width:100%">
<tr>
<th>
message
</th>
</tr>
while ($row = $resultSet->fetch_assoc()) {
echo "<td>" . $row['message'] . "</td>";
}
?>
但它会在水平方向上创建一个新框。我怎样才能让它垂直,我怎样才能让它不仅适用于一个 th 元素?
【问题讨论】:
标签: php html css css-tables