Javascript 使用bootstrapTable加载数据失败
我不熟悉引导,只是尝试复制几个将数据加载到引导表中的示例,但我的数据没有显示出来。以下是来自JSFIDLE的htmlJavascript 使用bootstrapTable加载数据失败,javascript,jquery,twitter-bootstrap,dynamic-data,Javascript,Jquery,Twitter Bootstrap,Dynamic Data,我不熟悉引导,只是尝试复制几个将数据加载到引导表中的示例,但我的数据没有显示出来。以下是来自JSFIDLE的html <table class="table" id="table"> <thead> <tr> <th data-field="id">Item ID</th> <th data-field="name">Item Name</th> <th da
<table class="table" id="table">
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
标题显示得很好,但数据显示得不好。是指向JSFIDLE的链接。引导表不随引导一起提供。你需要包括它
bootstrap datatable:非常有效。希望这篇文章能帮助别人。
var $table = $('#table');
var mydata = [{
"id": 0,
"name": "test0",
"price": "$0"
}];
$(function() {
$('#table').bootstrapTable(
data: mydata)
);
});
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>
<!-- Latest compiled and minified Locales -->
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>