【问题标题】:Bootstrap 3 how to make "aaaaa" in the middle of the head of table?Bootstrap 3如何在表头中间制作“aaaaa”?
【发布时间】:2014-02-17 06:51:35
【问题描述】:
<table class="table table-striped table-bordered table-condensed">
        <tr>
            <th colspan="2">aaaaa</th>
        </tr>
        <tr>
            <td>cccccccccc</td>
            <td>dddddddddd</td>
        </tr>
    </table>

如何用bootstrap在html表格的头部中间制作“aaaaa”?

【问题讨论】:

  • text-align: center; ?

标签: html css twitter-bootstrap twitter-bootstrap-3 text-alignment


【解决方案1】:

使用.text-center

<tr>
    <th colspan="2" class="text-center">aaaaaa</th>
</tr>

http://jsfiddle.net/52VtD/2045/

【讨论】:

    【解决方案2】:

    只需使用 CSS 样式 text-align 并将其设置为 center

    .table {
        text-align:center;
    }
    

    或者如果您只是希望表格标题居中对齐:

    .table th {
        text-align:center;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-16
      • 2013-06-27
      • 2023-04-07
      相关资源
      最近更新 更多