elementui table 表格前三行第三列数据标红

摘要:
1                    61011˂el-table-
1                             <el-table
2                                                 :cell-class-name="tableCellClassName"
3 height="350px"
4 :data="tableData"
5 style=" 100%">
6                                             <el-table-column
7                                                     type="index"
8 label="排名"
9 width="50">
10                                             </el-table-column>
11                                             <el-table-column
12                                                     prop="mineName"
13 label="矿山名称"
14 width="180">
15                                             </el-table-column>
16                                             <el-table-column
17                                                     prop="finishedRate"
18 label="完成率">
19                                                 <template slot-scope="scope">
20                                                     <el-row>
21                                                         <el-col :span="18">
22                                                             <el-progress
23                                                                     :percentage=(scope.row.finishedRate)
24                                                             ></el-progress>
25                                                         </el-col>
26                                                         <el-col :span="6" >
27                                                             <div >
28 {{scope.row.finishedRate+"%"}}
29                                                             </div>
30                                                         </el-col>
31                                                     </el-row>
32                                                 </template>
33                                             </el-table-column>
34                                        </el-table>

js:

tableCellClassName({row, column, rowIndex, columnIndex}: any) {
if (rowIndex <= 2) {
if (columnIndex == 2) {//前三行第三列表红
return 'warning-row';
}
} else {
if (columnIndex == 2) {
return 'no-warning-row';
}
}
}

css:

/deep/.el-table .warning-row {
        color: #ec5656;
}
/deep/ .el-table .no-warning-row {
color: #01b79d;
}

效果:

elementui table 表格前三行第三列数据标红第1张

免责声明:文章转载自《elementui table 表格前三行第三列数据标红》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇第2章:动态调试技术--OllyDbgvscode clang-format插件的使用下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Element UI Table合并行

Vue使用Element-ui Table 合并行,官方只是一个非常简单的合并例子,通常业务都是相同的某个字段进行合并。 效果图 代码实现 1、Table <el-table :data="dataTable" border :header-cell-style="{background: '#FAFAFA', textAlign:'center'...

vue+elementui +input输入框关键字筛选检索表格数据展示+分页功能

第一种用axios发送请求到后台,需要后台配合,才能在表格里面渲染页面;想偷懒的小伙建议去直接粘贴复制第三种 <template> <div class="tableDatas"> <div class="searchWord"> <div style="display: inline-block"> 搜索...

Mysql常用命令操作小结

Mysql操作大全 一、概述     SQL(Structured Query Language)语言的全称是结构化查询语言。数据库管理系统通过SQL语言来管理数据库中的数据。     SQL语言分为三个部分:数据定义语言(Data DefinitionLanguage,简称为DDL)、数据操作语言(DataManipulation Language,简称...

SparkSQL学习笔记

概述冠状病毒来临,宅在家中给国家做贡献之际,写一篇随笔记录SparkSQL的学习笔记,目的有二,一是记录整理之前的知识作为备忘录,二是分享技术,大家共同进步,有问题也希望大家不吝赐教。总体而言,大数据主要包含三种操作:长时间运行的批量数据处理;交互式运行的数据查询;实时数据流处理。sparkSQL特点:数据兼容,不仅兼容hive,还可以从rdd,parqu...

网上购物车数据库设计

一、概述 网上购物店的数据模型,它主要模式有产品:product ,帐户:Account,定单:Order。和产品相关的表有category ,product,item, inventory, supplier;和用户相关表有的account ,signon ,profile;和定单相关的表有orders,orderstatus,lineitem FK:...

table 设置每列的颜色

ISBN Title Price 3476896 My first HTML $53 5869207 My first CSS $49 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title><...