Bootstrap [3.3.4] - 如何正确拉出<table class =“table table-striped”> <tbody> <tr> <td>单元格

时间:2015-09-16 21:08:58

标签: twitter-bootstrap

版本3.3.4似乎已经改进了条形表内拉链的工作方式。

<div class="table-responsive">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>Column A</th>
                <th>Column B</th>
                <th>Column C</th>
                <th>Column D</th>
            </tr>
        </thead>
        <tbody>
        <tr>
            <td>Stuff</td>
            <td>More Stuff</td>
            <td class="pull-right">Right aligned! 100</td>
            <td>Last Stuff</td>
        </tr>
        </tbody>
    </table>
</div>

如果您查看此内容,您会在C列上看到表格条纹图案的细微变化

问题1:使用正确对齐的数据是否有更好的方法来处理列数据?

问题2:没有自定义CSS可以做到这一点吗?

问题3:是否可以在列标题上使用慢煮技术?当向右拉时,它们似乎也会丢失格式。

1 个答案:

答案 0 :(得分:1)

Bootstrap有 .text-right css类。在我的项目中,我使用这个类来对齐右侧的单元格数据。

https://jsfiddle.net/99x50s2s/110/

<td class="text-right">Right aligned! 100</td>

如果您想对标题或任何单元格数据进行居中对齐,请使用 .text-center

看到这个小提琴手:https://jsfiddle.net/99x50s2s/111/

相关问题