最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

bootstraptable怎么绑定数据

来源:动视网 责编:小采 时间:2020-11-27 15:02:07
文档

bootstraptable怎么绑定数据

bootstraptable怎么绑定数据:支持三种方式bootstrap table绑定数据:1.html格式数据(即静态数据);2.JavaScript传递数据;3.数据属性变量动态获取。静态表格:data-toggle="table"(推荐学习:Bootstrap视频教程)<table data-toggle="
推荐度:
导读bootstraptable怎么绑定数据:支持三种方式bootstrap table绑定数据:1.html格式数据(即静态数据);2.JavaScript传递数据;3.数据属性变量动态获取。静态表格:data-toggle="table"(推荐学习:Bootstrap视频教程)<table data-toggle="
 支持三种方式bootstrap table绑定数据:1.html格式数据(即静态数据);2.JavaScript传递数据;3.数据属性变量动态获取。

静态表格:data-toggle="table"(推荐学习:Bootstrap视频教程)

<table data-toggle="table">
 <thead>
 <tr>
 <th>Item ID</th>
 <th>Item Name</th>
 <th>Item Price</th>
 </tr>
 </thead>
 <tbody>
 <tr>
 <td>1</td>
 <td>Item 1</td>
 <td>$1</td>
 </tr>
 <tr>
 <td>2</td>
 <td>Item 2</td>
 <td>$2</td>
 </tr>
 </tbody>
</table>

JavaScript方式

<table id="table"></table>
<!--定义一个表格,无需设置表头,统一在JS中初始化,灵活度较高(梁新建议)-->
<script>
$('#table').bootstrapTable({
 url: 'data1.json',
 pagination: true,
 search: true
 columns: [{
 field: 'id',
 title: 'Item ID'
 }, {
 field: 'name',
 title: 'Item Name'
 }, {
 field: 'price',
 title: 'Item Price'
 }, ]
})
</script>

数据属性变量动态获取

<table
 data-toggle="table"
 data-url="data1.json"
 data-pagination="true"
 data-search="true">
 <thead>
 <tr>
 <th data-sortable="true" data-field="id">Item ID</th>
 <th data-field="name">Item Name</th>
 <th data-field="price">Item Price</th>
 </tr>
 </thead>
</table>

更多Bootstrap相关技术文章,请访问Bootstrap教程栏目进行学习!

文档

bootstraptable怎么绑定数据

bootstraptable怎么绑定数据:支持三种方式bootstrap table绑定数据:1.html格式数据(即静态数据);2.JavaScript传递数据;3.数据属性变量动态获取。静态表格:data-toggle="table"(推荐学习:Bootstrap视频教程)<table data-toggle="
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top