bootstrapTable 显示表格数据,其中有一列需要判断数字大小,这列数字大于1000,则字体变红,写一段代码
时间: 2023-06-03 20:01:43 浏览: 144
Sure, here's some code that should achieve what you're looking for:
```javascript
$(function() {
// assuming your table has a column with class "number-column"
$(".number-column").each(function() {
var num = parseFloat($(this).text());
if (num > 1000) {
$(this).css("color", "red");
}
});
});
```
This code uses jQuery to loop through every element with the class "number-column" in your table, and checks if the number in that cell is greater than 1000. If it is, it sets the color of the text to red using CSS.
Note that this code assumes your table is already loaded into the DOM and rendered on the page. If your table is loaded dynamically or via AJAX, you may need to use a different method to bind the code to the table cells.
阅读全文