当前位置:网站首页>Web页面table表格,实现快速筛选
Web页面table表格,实现快速筛选
2022-07-27 13:33:00 【紫薯馍馍】
谁用谁知道
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<!--jQuery-->
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<style>
table {
border:0;
}
p {
font:normal 12px/17px Arial;
}
td {
font:normal 12px/17px Arial;
padding:2px;
width:100px;
}
th {
font:bold 12px/17px Arial;
text-align:left;
padding:4px;
border-bottom:1px solid #333;
width:100px;
}
.even {
background:#FFF38F;
}
/* 偶数行样式*/
.odd {
background:#FFFFEE;
}
/* 奇数行样式*/
.selected {
background:#FF6500;
color:#fff;
}
</style>
</head>
<body>
<p>
<br> 筛选:
<input id="filterName" name="filterName">
<span class="search">搜索</span>
<br>
</p>
<table>
<thead>
<tr><th>姓名</th><th>性别</th><th>暂住地</th></tr>
</thead>
<tbody>
<tr><td>SYJ</td><td>男</td><td>河北秦皇岛市</td></tr>
<tr><td>李四</td><td>女</td><td>北京北京市</td></tr>
<tr><td>王五</td><td>男</td><td>河北秦皇岛市</td></tr>
<tr><td>赵六</td><td>男</td><td>河北唐山市</td></tr>
<tr><td>张三</td><td>男</td><td>内蒙古呼和浩特市</td></tr>
<tr><td>楠楠</td><td>女</td><td>内蒙古包头市</td></tr>
<tr><td>贝贝</td><td>男</td><td>北京北京市</td></tr>
<tr><td>西西</td><td>女</td><td>河北秦皇岛市</td></tr>
<tr><td>冬冬</td><td>男</td><td>东北辽宁省</td></tr>
</tbody>
</table>
<!--排序函数-->
<script type="text/javascript">
$(function() {
$('.search').on('click', function() {
// console.log($('#filterName').val());
$('table tbody tr').hide()
.filter(":contains('" + ($('#filterName').val()) + "')")
.show();
})
})
</script>
</body>
</html> 边栏推荐
- Docker practical experience: deploy mysql8 master-slave replication on docker
- Unity3d learning note 10 - texture array
- codeforces 1708E - DFS Trees
- poj3461 Oulipo【KMP】
- Forward proxy and reverse proxy
- Docker实践经验:Docker 上部署 mysql8 主从复制
- JS what is declaration in advance? The order of function and variable declaration in advance (the foreshadowing of execution context)
- DVWA全级别通关教程
- Spark job uses log4j appender to append logs to local files or mysql
- Unity3D学习笔记10——纹理数组
猜你喜欢

软件产品第三方测试费用为什么没有统一的报价?

Summary of basic knowledge of C language

What you want most is the most comprehensive summary of C language knowledge. Don't hurry to learn

融合迁移学习与文本增强的中文成语隐喻知识识别与关联研究

面试官问:如何判断一个元素是否在可视区域?

DVWA full level customs clearance tutorial

Airport cloud business sign analysis

万字详解 Google Play 上架应用标准包格式 AAB

STM32 - capacitive touch button experiment

Research on Chinese idiom metaphorical knowledge recognition and relevance based on transfer learning and text enhancement
随机推荐
HDU4565 So Easy! [matrix multiplication] [derivation]
基于招聘广告的岗位人才需求分析框架构建与实证研究
What open source projects of go language are worth learning
面向流行性疾病科普的用户问题理解与答案内容组织
巨形象的图解 SQL
文献翻译__tvreg v2:用于去噪、反卷积、修复和分割的变分成像方法(部分)
C language layered understanding (C language array)
Vscode -- create template file
Why does script file 'd:\anaconda3\envs\pad appear_ env\Scripts\pip-script. py‘ is not present.
Basic exercises of C language
自动化配置SSH免密登录和取消SSH免密配置脚本
np. Usage and difference of range() and range()
这年头谁还不会抓包,WireShark 抓包及常用协议分析送给你!
SLAM综述阅读笔记七:Visual and Visual-Inertial SLAM: State of the Art, Classification,and Experimental 2021
Utnet hybrid transformer for medical image segmentation
Navicate报错access violation at address 00000000
log4j2 jdbc appender
Shell programming specifications and variables
Unity3d learning note 10 - texture array
连接ResourceManager 失败