【问题标题】:Fetch data from table and display it in bootstrap table从表中获取数据并将其显示在引导表中
【发布时间】:2014-03-17 11:55:30
【问题描述】:

我正在从表格 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>
            ';

        }

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

我在这里使用了引导 css

喜欢

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

点击按钮时显示内容。

【问题讨论】:

  • 如果要显示一个表中的所有数据,那么不要为每条记录创建一个表...
  • 谢谢,我没注意到

标签: php css twitter-bootstrap


【解决方案1】:

试试这个:

    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>';

【讨论】:

    猜你喜欢
    • 2021-02-18
    • 1970-01-01
    • 1970-01-01
    • 2019-04-12
    • 2013-02-14
    • 2019-02-26
    • 1970-01-01
    • 2020-04-29
    • 2018-07-13
    相关资源
    最近更新 更多