bootstrap-table方法之:合并单元格
方法一 通过mergeCells方法
演示地址:http://issues.wenzhixin.net.cn/bootstrap-table/methods/mergeCells.html
Merge some cells to one cell, the options contains following properties:
index: the row index.
field: the field name.
rowspan: the rowspan count to be merged.
colspan: the colspan count to be merged.$table.bootstrapTable('mergeCells', {index: 1, field: 'name', colspan: 2, rowspan: 3});
功能描述:合并单元格
方法一 通过columns参数中存放数组的形式
例:
$("#table").bootstrapTable({ dataType: "json", method: 'get', contentType: "application/x-www-form-urlencoded", cache: false, url:"../data/mergeData.json", columns:[ [ { "title": "洗衣机统计表", "halign":"center", "align":"center", "colspan": 5 } ], [ { field: 'name', title: "功能分组", valign:"middle", align:"center", colspan: 1, rowspan: 2 }, { title: "美的", valign:"middle", align:"center", colspan: 2, rowspan: 1 }, { title: "松下", valign:"middle", align:"center", colspan: 2, rowspan: 1 } ], [ { field: 'mideaNum', title: '数量', valign:"middle", align:"center" }, { field: 'mideaPercent', title: '占比', valign:"middle", align:"center" }, { field: 'panasonicNum', title: '数量', valign:"middle", align:"center" }, { field: 'panasonicPercent', title: '占比', valign:"middle", align:"center" } ] ] })
知识只有共享才能传播,才能推崇出新的知识,才能学到更多,这里写的每一篇文字/博客,基本都是从网上查询了一下资料然后记录下来,也有些是原滋原味搬了过来,也有时加了一些自己的想法