[英]DIV / Table Headers are on bottom, jSON data is on top?
我似乎無法弄清楚這一點。 我沒有運氣就嘗試了各種各樣的事情。 有關如何解決此問題的任何想法?
我已附上一個鏈接,以獲取所獲取內容的屏幕截圖...
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>
我能夠解決它。 必須將JSON輸出從div更改為Tbody。 :)
將您的JSON輸出從DIV更新為TBody應該可以為您提供幫助。
<div> <tr>
<th>Count</th>
<th>Item</th>
</tr>
</div>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.