gpt4 book ai didi

php - 从表中获取数据并将其显示在 Bootstrap 表中

转载 作者:行者123 更新时间:2023-11-28 11:00:49 25 4
gpt4 key购买 nike

我正在从表 insdie php 脚本中获取数据并显示在表中。此 php 脚本由按钮单击事件调用。

这是执行此操作的 php 代码:

        while ($row = @mysqli_fetch_array($result))
{

echo '<div class = "c2">
<table class="table table-condensed">
<tbody>
<tr class="active">
<td class="active"></td>
<td class="active">'.$row['date'].'</td>
<td class="success">'.$row['time'].'</td>
<td class="warning">'.$row['username'].'</td>
<td class="danger">'.$row['user_follower_count'].'</td>
<td class="info">'.$constant.'</td>
<td class="active">'.$row['tweet_text'].'</td>
<td class="success">...dfd</td>
</tr>
</tbody>
</div>
';

}

但是内容显示看起来很乱。

我在这里使用了 bootstrap css

喜欢

enter image description here

如何以正确的方式显示所有行以相同的宽度显示?

点击按钮时显示内容。

最佳答案

试试这个:

    echo '<div class="c2"><table class="table table-condensed"><tbody>';
while ($row = @mysqli_fetch_array($result))
{

echo '<tr class="active">
<td class="active"></td>
<td class="active">'.$row['date'].'</td>
<td class="success">'.$row['time'].'</td>
<td class="warning">'.$row['username'].'</td>
<td class="danger">'.$row['user_follower_count'].'</td>
<td class="info">'.$constant.'</td>
<td class="active">'.$row['tweet_text'].'</td>
<td class="success">...dfd</td>
</tr>';

}
echo '</tbody></table></div>';

关于php - 从表中获取数据并将其显示在 Bootstrap 表中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22453640/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com