springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 12:36:47
82
我正在尝试将SQL查询的结果放入表中,每次有新的结果时,都会创建一个新的表数据框。我的代码看起来像
<代码><;HTML(>;)<;样式>;桌子{字体系列:宋体,无衬线;border-collapse:崩溃;宽度:100%;}TD,TH{边框:1px实线#dddddd;文本对齐:左;填充:8px;}<;/样式>;<;?PHP<;表格样式=";宽度:100%";>;<;TR>;<;TH>;信息<;/th>;<;/tr>;while($row=$resultset-amp;gt;fetch_assoc()){回声";<;TD>;";.$row[' message '].";<;/TD>;";}?>;
但是它水平地做了一个新的盒子。我怎样才能使它垂直,我也可以使它不只是一个<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
s(表示表中的新行)
<tr>
如果你想使用更多的<代码><;TH>;的,那么你需要添加更多的while ($row = $resultSet->fetch_assoc()) {
echo '<tr>';
echo '<td>' . $row['message'] . '</td>';
echo '</tr>';
}
的.
<代码><;表格样式=";宽度:100%";>;<;TR>;<;TH>;信息<;/th>;<;TH>;福<;/th>;<;/tr>;while($row=$resultset-amp;gt;fetch_assoc()){回音'<;tr>;';回声'<;TD>;'。$row['消息'].'<;/TD>;';回声'<;TD>;'。$row[' foo '].'<;/TD>;';回音'<;/tr>;';}?>;<;/表格>;
<th>
和while ($row = $resultSet->fetch_assoc()) {
echo '<tr>';
echo '<td>' . $row['message'] . '</td>';
echo '</tr>';
}
用于设置列和<table style="width:100%">
<tr>
<th>
message
</th>
<th>
foo
</th>
</tr>
while ($row = $resultSet->fetch_assoc()) {
echo '<tr>';
echo '<td>' . $row['message'] . '</td>';
echo '<td>' . $row['foo'] . '</td>';
echo '</tr>';
}
?>
</table>
用于设置行。所以只要确保你有相同数量的<th>
和while ($row = $resultSet->fetch_assoc()) {
echo '<tr>';
echo '<td>' . $row['message'] . '</td>';
echo '</tr>';
}
的.
我建议您仔细阅读HTML表格的工作原理。
包装A<代码><;TR>;是<tr>
表格数据.
<th>
不要忘记在循环后结束表,如果这是您想要做的。
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11