Bootstrap 3调整表数据和输入字段

时间:2016-02-25 17:07:18

标签: javascript jquery html css twitter-bootstrap

我正在尝试调整表的输入/ 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>

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:0)

对我而言,这有效:

<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>