Skip to content Skip to sidebar Skip to footer

How To Concatenate Html Stylized Table With Php And Sql

So, i have this code that returns me a simple table with the correct db values: Código

Solution 1:

To provide a full solution:

<table class="table table-striped projects">
    <thead>
        <tr>
            <th style="width: 1%">#</th>
            <th style="width: 20%">Nome</th>
            <th>Membros Recentes</th>
            <th>Project Progress</th>
            <th>Status</th>
            <th style="width: 20%">#Edit</th>
        </tr>
    </thead>

    <?php while($coluna_bd_tabela = mysqli_fetch_array($sql_indicador_resul)){ ?>
            <tbody>
                <tr>
                    <td><?php echo $coluna_bd_tabela['usu_codigo']; ?></td>
                    <td>
                        <a><?php echo $coluna_bd_tabela['usu_nome']; ?></a>
                        <br />
                        <small><?php echo $coluna_bd_tabela['usu_indicou']; ?></small>
                    </td>
                    <td>
                        <ul class="list-inline">
                            <li>
                                <img src="images/user.png" class="avatar" alt="Avatar">
                            </li>
                            <li>
                                <img src="images/user.png" class="avatar" alt="Avatar">
                            </li>
                            <li>
                                <img src="images/user.png" class="avatar" alt="Avatar">
                            </li>
                            <li>
                                <img src="images/user.png" class="avatar" alt="Avatar">
                            </li>
                        </ul>
                    </td>
                    <td class="project_progress">
                        <div class="progress progress_sm">
                            <div class="progress-bar bg-green" role="progressbar" data-transitiongoal="57"></div>
                        </div>
                        <small>57% Complete</small>
                    </td>
                    <td>
                        <button type="button" class="btn btn-success btn-xs">Success</button>
                    </td>
                    <td>
                        <a href="#" class="btn btn-primary btn-xs"><i class="fa fa-folder"></i> View </a>
                        <a href="#" class="btn btn-info btn-xs"><i class="fa fa-pencil"></i> Edit </a>
                        <a href="#" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i> Delete </a>
                    </td>
                </tr>
            </tbody>
    <?php } ?>
</table>

You forgot to use the <?php and ?> opening and closing tags around the echo statements. Furthermore, you missed the ; at the end of each statement. I've also moved the beginning and the end of the table out of PHP's echo since I believe it looks much clearer this way.


Post a Comment for "How To Concatenate Html Stylized Table With Php And Sql"