【问题标题】:Bootstrap 3 resize table data and input fieldsBootstrap 3 调整表数据和输入字段的大小
【发布时间】:2016-06-08 14:36:39
【问题描述】:

我正在尝试调整表格的输入/td 字段的大小,但似乎无法正常工作。我一直在参考下面的堆栈帖子。还是没有运气。

stack-post-ref

jsfiddle-for-table

<div class="table-responsive">
  <table class="table">
    <thead>
      <tr>
        <th>XS</th>
        <th>S</th>
        <th>M</th>
        <th>L</th>
        <th>XL</th>
        <th>XXL</th>
        <th>XXXL</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="col-md-1"><input type="number" name="xs" ng-model="order.size.extra_small"></td>
        <td class="col-md-1"><input type="number" name="s" ng-model="order.size.small"></td>
        <td class="col-md-1"><input type="number" name="m" ng-model="order.size.medium"></td>
        <td class="col-md-1"><input type="number" name="l" ng-model="order.size.large"></td>
        <td class="col-md-1"><input type="number" name="xl" ng-model="order.size.extra_large"></td>
        <td class="col-md-1"><input type="number" name="xxl" ng-model="order.size.double_extra_large"></td>
        <td class="col-md-1"><input type="number" name="xxxl" ng-model="order.size.triple_extra_large"></td>
      </tr>
    </tbody>
  </table>
</div>

【问题讨论】:

  • 为什么要尝试制作表格并使用引导程序中的列样式,这似乎是多余的?要么将其拆分为列以使用 col-xx-# 选择器调整大小,要么按照下面的答案建议,自己设置表格样式

标签: javascript jquery html css twitter-bootstrap


【解决方案1】:

form-control 类添加到您的input 字段https://jsfiddle.net/NourSammour/u2c09yb5/1/

【讨论】:

    【解决方案2】:

    对我来说这是可行的:

    <div class="table-responsive">
                <table class="table table-striped">
                  <thead>
                    <tr>
                      <th>#</th>
                      <th>Header</th>
                      <th>Header</th>
                      <th>Header</th>
                      <th>Header</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <td><input type... /></td>
                      <td>libero</td>
                      <td>Sed</td>
                      <td>cursus</td>
                      <td>ante</td>
                    </tr>
                    <tr>
                      <td>1,004</td>
                      <td>dapibus</td>
                      <td>diam</td>
                      <td>Sed</td>
                      <td>nisi</td>
                    </tr>
                  </tbody>
                </table>
              </div>
    

    【讨论】:

      猜你喜欢
      • 2013-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多