BootStrap 怎样调整<td>的宽度

//对于 Bootstrap 3.0

For Bootstrap 3.0:

// class="col-md-*"  其中的*表示列的宽度

With twitter bootstrap 3 use: class="col-md-*" where * is a number of columns of width.

 
  1. <tr class="something">

  2. <td class="col-md-2">A</td>

  3. <td class="col-md-3">B</td>

  4. <td class="col-md-6">C</td>

  5. <td class="col-md-1">D</td>

  6. </tr>

//对于 Bootstrap 2.0

For Bootstrap 2.0:

// class = "span*" 其中的*表示列的宽度

With twitter bootstrap 2 use: class="span*" where * is a number of columns of width.

 
  1. <tr class="something">

  2. <td class="span2">A</td>

  3. <td class="span3">B</td>

  4. <td class="span6">C</td>

  5. <td class="span1">D</td>

  6. </tr>

// 如果有<th> 元素,在 th 上设置同样有效。

** If you have <th> elements set the width there and not on the <td> elements.

没有亲自试过,不过觉的 Twitter  的工程师真是脑洞大开。

猜你喜欢

转载自blog.csdn.net/qq_19004627/article/details/81253085