Bootstrap中的响应表,具有相同宽度的列

时间:2014-05-22 17:31:19

标签: php html twitter-bootstrap html-table

这是代码,正如标题中所写,我试图让每列具有相同的宽度:

<div class="table-responsive">
<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th>N°</th>
            <th>Data</th>
            <th>Compratore</th>
            <th>Venditore</th>
            <th>Merce</th>
            <th>Quantita'</th>
            <th>Prezzo</th>
            <th>Pagamento</th>
            <th>Azioni</th>
        </tr>
    </thead>
    <tbody>
    <?php                                   

        $result = query("SELECT numero_contratto, anno_contratto, data, C.denominazione as compratore, V.denominazione as venditore, merce, quantita, info_quantita, prezzo, info_prezzo, pagamento FROM Contratti, Societa V, Societa C WHERE compratore = C.id_societa and venditore = V.id_societa ORDER BY data DESC", $conn);

        foreach($result as $r)
        {
    ?>
            <tr>
                <td>
                    <?php echo $r['numero_contratto']."/".$r['anno_contratto']; ?>
                </td>
                <td>
                    <?php 
                        $data = explode("-", $r['data']);
                        echo $data[2]."-".$data[1]."-".$data[0];
                    ?>
                </td>
                <td>
                    <?php echo $r['compratore']; ?>
                </td>
                <td>
                    <?php echo $r['venditore']; ?>
                </td>
                <td>
                    <?php echo $r['merce']; ?>
                </td>
                <td>
                    <?php echo $r['quantita']." ".$r['info_quantita']; ?>
                </td>
                <td>
                    <?php echo $r['prezzo']." ".$r['info_prezzo']; ?>
                </td>
                <td>
                    <?php echo $r['pagamento']; ?>
                </td>
                <td>
                    <span class="glyphicon glyphicon-remove"></span>
                </td>
            </tr> 
    <?php
        }
    ?>                            
    </tbody>
</table>
</div>

这是我网页上的输出:

但是如果你看到这个小提琴的静态值被放入表中,问题就不会显示出来! http://jsfiddle.net/brVa9/1/

所以问题出在db模式或结构中。

如何让所有列具有相同的宽度?

0 个答案:

没有答案