HTML无法正确显示,列嵌套在另一列中

时间:2014-01-11 18:14:07

标签: html css twitter-bootstrap

我在文本编辑器中键入的内容在chrome和firefox中都没有正确显示,我已经多次检查了我的代码并且已经有了一个linter。

所以我写的代码是

<div class="row">
    <div class="col-md-5 col-md-offset-1">
      <div class= "panel panel-danger" id= "list_down">
        <div class="panel-heading">Your Forms</div>
        <table class= "table table-hover">
          <thead>
          <tr>
            <th>Application</th>
            <th>Month</th>
            <th>Due Date</th>
            <th>Completion</th>
          </tr>
        </thead>
        <tbody>
          <tr href ="google.com">
              <td>Project Manager</td>
              <td>February</td>
              <td>02/1/2013</td>
              <td>Not Completed</td>
            </tr>
          </tbody
        </table> <!-- table -->
      </div> <!-- panel -->
      </div> <!-- column -->
  <div class="col-md-3" id="list_down">
        <h4>Data Analysis</h4>
      </div> <!-- columns 2 -->
  </div> <!-- row 2 -->

所以我的行中应该有2个列,但是Web控制台显示的是

<div class="row">
    <div class="col-md-5 col-md-offset-1">
      <div class="panel panel-danger" id="list_down">
        <div class="panel-heading">Your Forms</div>
        <div class="col-md-3" id="list_down">
        <h4>Data Analysis</h4>
      </div><table class="table table-hover">
          <thead>
          <tr>
            <th>Application</th>
            <th>Month</th>
            <th>Due Date</th>
            <th>Completion</th>
          </tr>
        </thead>
        <tbody>
          <tr href="google.com">
              <td>Project Manager</td>
              <td>February</td>
              <td>02/1/2013</td>
              <td>Not Completed</td>
            </tr>
          </tbody> <!-- table -->
       <!-- panel -->
       <!-- column -->
   <!-- columns 2 -->
   <!-- row 2 -->

 <!-- container -->

<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
$( ".clipboard_icon" ).click(function() {
  $( this ).hide();
  $( ".clipboard_icon_active").show();
  $( ".form_notif").show();
  $( ".msg_icon").show();
  $( ".msg_icon_active").hide();
  $( ".msg_notif").hide();

});

$( ".clipboard_icon_active" ).click(function() {
  $( this ).hide();
  $( ".form_notif").hide();
  $( ".clipboard_icon").show();
});

$( ".msg_icon" ).click(function() {
  $( this ).hide();
  $( ".clipboard_icon_active").hide();
  $( ".form_notif").hide();
  $( ".msg_icon_active").show();
  $( ".msg_notif").show();
  $( ".clipboard_icon").show();
});

$( ".msg_icon_active" ).click(function() {
  $( this ).hide();
  $( ".msg_notif").hide();
  $( ".msg_icon").show();
});

$('tr').click(function() {
    if($(this).attr('href') !== undefined)
{
    document.location = $(this).attr('href');
}
});
</script>  </table></div></div></div>

由于某些奇怪的原因,它将列嵌入面板内部..

1 个答案:

答案 0 :(得分:0)

</tbody>标记未关闭,您错过了“&gt;” ,我没有看到另一个问题或者可能是小组成员:

    <div class="row">
        <div class="col-md-5 col-md-offset-1">
          <div class= "panel panel-danger" id= "list_down">
            <div class="panel-heading">Your Forms</div>
            <div class="panel-body">
               <table class= "table table-hover">
                 <thead>
                   <tr>
                     <th>Application</th>
                     <th>Month</th>
                     <th>Due Date</th>
                     <th>Completion</th>
                   </tr>
                 </thead>
                 <tbody>
                   <tr href ="google.com">
                     <td>Project Manager</td>
                     <td>February</td>
                     <td>02/1/2013</td>
                     <td>Not Completed</td>
                   </tr>
                 </tbody> <!-- HERE! -->
               </table> <!-- table -->
           </div> <!-- panel body -->
          </div> <!-- panel -->
       </div> <!-- column -->
      <div class="col-md-3" id="list_down">
            <h4>Data Analysis</h4>
          </div> <!-- columns 2 -->
      </div>