字段设置:

<th data-field="wrongpercent" data-align="center" data-formatter="wrongPercent">错误率%</th>

格式化方法:

function wrongPercent(value, row, index) {
        var res = 100 * row.wrongnums / row.testnums;
        return ["<div class='progress'> <div class='progress-bar' role='progressbar' aria-valuenow='50' aria-valuemin='0' aria-valuemax='100' style='width:"+res.toFixed(2)+"%'>"+res.toFixed(2)+"</div> </div>"];
//        return res.toFixed(2);
    }

效果:

bootstrap table 中嵌入百分比进度条

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
  • 2021-10-13
  • 2021-11-25
  • 2021-10-28
  • 2021-08-28
  • 2021-09-26
猜你喜欢
  • 2022-01-06
  • 2022-12-23
  • 2021-12-25
  • 2021-12-25
  • 2021-11-13
  • 2022-01-17
  • 2021-12-19
相关资源
相似解决方案