Bootstrap Table
by jimkennelly
HTML
<link rel="stylesheet" href="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.css">
<script src="https://rawgit.com/wenzhixin/bootstrap-table/master/src/bootstrap-table.js"></script>
<table id="table">
<thead>
<tr>
<th data-field="C_FO_ID">FO</th>
<th data-field="CminM" data-cell-style="cellStyle" data-qqqformatter="formatX">CminM</th>
<th data-field="CmaxM" data-cell-style="cellStyle">CmaxM</th>
<th data-field="CminC" data-cell-style="cellStyle">CminC</th>
<th data-field="CmaxC" data-cell-style="cellStyle">CmaxC</th>
</tr>
</thead>
</table>
JavaScript
var d =[{"C_FO_ID":"9116760001","CminM":0.28,"CmaxM":0.33,"CminC":0.28,"CmaxC":0.33},
{"C_FO_ID":"9116760001","CminM":0.28,"CmaxM":0.33,"CminC":0.28,"CmaxC":0.33},
{"C_FO_ID":"9116760001 no cust min/max","CminM":0.28,"CmaxM":0.33,"CminC":null,"CmaxC":null},
{"C_FO_ID":"9116760001 no cust min","CminM":0.28,"CmaxM":0.33,"CminC":null,"CmaxC":0.33},{"C_FO_ID":"9116760001 no cust max","CminM":0.28,"CmaxM":0.33,"CminC":0.28,"CmaxC":null}]
$(function () {
//alert(d[0].C_FO_ID)
$('#table').bootstrapTable({
data: d,
});
function formatX(value,row,index){
return value;
}
});
function cellStyle(value, row, index,field) {
return { classes: ['success']};
}