2016-01-06 146 views
0

我遇到需要跨多行垂直对齐项目。从Plunker可以看出,Font Awesome图标并未与下面的所有复选框对齐。如何将图标与复选框的行对齐?表格中有更多列被删除以供发布。在复选框上有保证金左侧和保证金右侧。Bootstrap 3跨多行垂直对齐

HTML:

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> 

    <title>F Trace</title> 

    <!-- Bootstrap core CSS --> 
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> 
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"> 

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> 
    <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet"> 

    <!-- Custom styles for this template --> 
    <link href="style.css" rel="stylesheet"> 



    <!-- Just for debugging purposes. Don't actually copy these 2 lines! --> 
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]--> 
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script> 

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> 
    <!--[if lt IE 9]> 
     <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> 
     <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> 
    <![endif]--> 
    </head> 

    <body> 

     <section id='top5'> 
      <div class='container tables'> 
       <div class='row'> 
        <div class='col-md-12 settings'> 
         <table class="table text-center custom-table"> 
          <thead> 
           <tr> 
            <th width="12%"><div>Инженерные системы</div><div class='controls'><i class="fa fa-bolt"></i><i class="fa fa-tint"></i><i class="fa fa-lightbulb-o"></i><i class="fa fa-yelp"></i><i class="fa fa-sun-o"></i><i class="fa fa-cogs"></i></div></th> 
           </tr> 
          </thead> 
          <tbody> 
           <tr> 
            <td class="vert-align checkboxes"><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input></td> 
           </tr> 
           <tr> 
            <td class="vert-align checkboxes"><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input></td> 
           </tr> 
           <tr> 
            <td class="vert-align checkboxes"><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input><input type='checkbox'></input></td> 
           </tr> 
          </tbody> 
         </table> 
        </div> 
       </div> 
      </div> 
     </section> 

    <!-- Bootstrap core JavaScript 
    ================================================== --> 
    <!-- Placed at the end of the document so the pages load faster --> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> 
    <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script> 
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script> 
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug --> 
    <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script> 
    </body> 
</html> 
+0

你可以创建一个小提琴吗? –

+0

我会将其他答案标记为已接受的答案。我必须继续编码页面的其余部分,所以不能创建小提琴。谢谢。 –

回答

0

尝试使用相同尺寸的图标。或者设置div.controls i {width: 10px;}

Plunker

+0

现在看起来更好!谢谢。如果您不介意,请解释一下{width:10px;}的变化? –

+0

它改变了嵌套在div类'控件'中的所有图标的宽度。 –

+0

@Münich。谢谢。 –