当前位置:网站首页>JS modify table font and table border style
JS modify table font and table border style
2022-07-28 19:22:00 【Susan flower rain】
1. example :js modify table Fonts and table Border style
Here is the complete code
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ee</title>
<style >
.table3 {
width: 500px;
height: 50px;
font-size: 80%;
color: black;
}
.table3 th {
width: 25%;
border: rgba(53, 182, 237, 1) 2px solid;
}
.table4 {
width: 500px;
height: 100px;
font-size: 70%;
text-align: center;
}
.table4 td {
width: 25%;
line-height: 2.3rem;
border: rgba(53, 182, 237, 1) 2px solid;
}
</style>
</head>
<body>
<table class="table3" cellpadding="0" cellspacing="0">
<tr>
<th> Equipment name </th>
<th> Early warning information </th>
<th> estimated time </th>
<th> count down </th>
</tr>
</table>
<table class="table4" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>aaaaaaa</td>
<td>sss</td>
<td>11:36:28</td>
<td class="checkstate"> Processing </td>
</tr>
<tr>
<td>adasdaqwa</td>
<td>sss</td>
<td>11:36:35</td>
<td class="checkstate"> Abnormal </td>
</tr>
<tr>
<td>adsadsad</td>
<td>sss</td>
<td>11:20:20</td>
<td class="checkstate">0.62min</td>
</tr>
<tr>
<td>asadsaad</td>
<td>xxx</td>
<td>11:15:20</td>
<td class="checkstate">0.80min</td>
</tr>
</tbody>
</table>
<script src="jquery-3.3.1.js"></script>
<script>
$(function () {
setfontcolor();// Modify the font color in the table
setsystle();// Modify table border color
})
function setfontcolor() {
// Change the font color of interlaced lines according to different contents
var stas = [" Processing ", " Abnormal "];
$(".table4").find("tr").each(function () {
for (var i = 0; i < stas.length; i++) {
if ($(this).children(' td:eq(3)').text() == stas[0]) {
$(this).css('color', 'red');
}
if ($(this).children(' td:eq(3)').text() == stas[1]) {
$(this).css('color', 'red');
}
}
});
}
// Set table style
function setsystle(){
$('.table3 tr').each(function () {
$(this).children('th').each(function (i) {
if (i == 2) {
$(this).css('border', '#FF9900 1px solid');
}
if (i == 3) {
$(this).css('border', '#FF9900 1px solid');
}
})
})
$('.table4 tr').each(function () {
$(this).children('td').each(function (i) {
if (i == 2) {
$(this).css('border', '#FF9900 1px solid');
}
if (i == 3) {
$(this).css('border', '#FF9900 1px solid');
}
})
})
}
</script>
</body>
</html>
2. Picture effect 
边栏推荐
- 当CNN遇见Transformer《CMT:Convolutional Neural Networks Meet Vision Transformers》
- C语言循环语句强化练习题
- Applet applet jump to official account page
- 顺序线性表——课上练
- Libgdx learning path 01: libgdx introduction and running tutorial
- SQL audit tool self introduction owls
- As for the white box test, you have to be skillful in these skills~
- Kotlin Android development novice tutorial
- VAE:变分自编码器的理解与实现
- How big is it suitable for learning software testing?
猜你喜欢
![[image hiding] digital image information hiding system based on DCT, DWT, LHA, LSB, including various attacks and performance parameters, with matlab code](/img/a4/5c5a90508e2f9c6b4f8e234bdfdc9e.png)
[image hiding] digital image information hiding system based on DCT, DWT, LHA, LSB, including various attacks and performance parameters, with matlab code
![[radar] radar signal online sorting based on kernel clustering with matlab code](/img/56/1f8e8690b47fc4a1f101d4e530b87f.png)
[radar] radar signal online sorting based on kernel clustering with matlab code

vim学习手册

uwb模块实现人员精确定位,超宽带脉冲技术方案,实时厘米级定位应用

关于ASM冗余问题

Pytorch:交叉熵损失(CrossEntropyLoss)以及标签平滑(LabelSmoothing)的实现

SRS4.0安装步骤

用于异常检测的Transformer - InTra《Inpainting Transformer for Anomaly Detection》

FTM module of K60: configure motor, encoder and steering gear

Srs4.0 installation steps
随机推荐
Pytorch:交叉熵损失(CrossEntropyLoss)以及标签平滑(LabelSmoothing)的实现
Learn from Li Mu, deep learning - linear regression and basic optimization function
Remember a uniapp experience
[physical application] atmospheric absorption loss with matlab code
TSDB and blockchain
[machine learning] support vector machine classification
智能合约安全——溢出漏洞
OAI L3 and L2 interface analysis
Applet applet jump to official account page
Cv5200 wireless WiFi communication module, wireless video image transmission, real-time wireless communication technology
Random finite set RFs self-study notes (6): an example of calculation with the formula of prediction step and update step
剑指 Offer II 109. 开密码锁
BM14 链表的奇偶重排
Qt: 一个SIGNAL绑定多个SLOT
Application value of MES production management system to equipment
PyG搭建异质图注意力网络HAN实现DBLP节点预测
当CNN遇见Transformer《CMT:Convolutional Neural Networks Meet Vision Transformers》
Libgdx learning path 01: libgdx introduction and running tutorial
Is zero basic software testing training reliable?
Qt: one signal binds multiple slots