2015-09-21 56 views
0

我似乎無法找出這一個。我嘗試了各種各樣的事情,但沒有運氣。任何想法如何解決這個問題?DIV /表頭處於底部,jSON數據位於頂部?

我附上一個鏈接,我所得到的截圖...

http://s23.postimg.org/4eu3mhmyj/Capture.png

<div class="container"> 
    <div class="panel panel-default"> 
     <div class="panel-heading clearfix"> 
      <h4 class="panel-title pull-left" style="padding-top: px;">Counts</h4> 
         <form method="POST" action=""> 
        <button type="submit" class="btn btn-default btn-sm pull-right" name="reset"><span class="glyphicon glyphicon-refresh"></span></button> 
      </form> 
     </div> 
      <table class="table"> 
      <thead> 
      <div> <tr> 
        <th>Count</th> 
        <th>Item</th> 
       </tr> 
       </div> 

    <tbody> 
      <div id="JSON_output" class="row"> 
          </div> 
         </tbody> 
           <script type="text/javascript"> 
     jQuery.ajax({ 
        type: "GET", 
        url: "json.php", 
        dataType: "json", 
        success: function(response){ 
         $.each(response, function(key, value){ 
          var html = '' + 
           '<tr><td><ul>'+value.count+'</ul></th>'+ 
           '<td><ul><ul><ul>'+value.item+'</ul></ul></ul></td></tr>'+ 
           ''; 
          $("#JSON_output").append(html); 
         }); 
         } 
         }); 
       </script> 


     </thead>  
     </table> 
    </div> 
</div> 
+0

無法真正看到圖像。另外,添加CSS將幫助我們追蹤您的問題。我認爲你的問題是與CSS。你也嘗試檢查輸出的HTML嗎? –

回答

1

更新您的JSON輸出從DIV到TBody應該會幫助你。

<div> <tr> 
        <th>Count</th> 
        <th>Item</th> 
       </tr> 
       </div> 
1

我能解決這個問題。必須將JSON輸出從div更改爲Tbody。 :)

+0

請使用您問題上的編輯鏈接添加更多信息。後回答按鈕應該只用於問題的完整答案。 – leesei

+0

@leesei爲什麼這樣?看起來OP已經找到了他的問題的答案。 –

+0

這是我自己問題的答案。我後來解決了它.... – Levi