当前位置:网站首页>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> 边栏推荐
- Airport cloud business sign analysis
- Research on Chinese idiom metaphorical knowledge recognition and relevance based on transfer learning and text enhancement
- The difference between [x for X in list_a if not np.isnan (x)] and [x if not np.isnan (x) else none for X in list_a]
- SLAM综述阅读笔记七:Visual and Visual-Inertial SLAM: State of the Art, Classification,and Experimental 2021
- What open source projects of go language are worth learning
- 基于企业知识图谱的企业关联关系挖掘
- Simple encapsulation steps of request data request of uniapp
- SLAM综述阅读笔记四:A Survey on Deep Learning for Localization and Mapping: Towards the Age of Spatial 2020
- mysql保存数据提示:Out of range value for column错误
- PROFINET 模拟器使用教程
猜你喜欢

进程间通信

Chinese character style transfer --- antagonistic discriminative domain adaptation (L1)

Electronic bidding procurement mall system: optimize traditional procurement business and speed up enterprise digital upgrading

STM32 - capacitive touch button experiment

文献翻译__基于自适应全变差L1正则化的椒盐图像去噪

面向流行性疾病科普的用户问题理解与答案内容组织

线程知识总结

Navicate reports an error access violation at address 00000000

Understand JS execution context in an article

JS epidemic at home, learning can't stop, 7000 word long text to help you thoroughly understand the prototype and prototype chain
随机推荐
Spark job uses log4j appender to append logs to local files or mysql
How to solve cache avalanche, breakdown and penetration problems
初学者入门:使用WordPress搭建一个专属自己的博客
aac 和 h264等的时间戳
C语言基础练习题目
"Game engine light in light out" 4.1 unity shader and OpenGL shader
SLAM综述阅读笔记六:基于图像语义的SLAM调研:移动机器人自主导航面向应用的解决方案 2020
Slam overview Reading Note 6: slam research based on image semantics: application-oriented solutions for autonomous navigation of mobile robots 2020
Toward Fast, Flexible, and Robust Low-Light Image Enhancement(实现快速、灵活和稳健的弱光图像增强)CVPR2022
软件产品第三方测试费用为什么没有统一的报价?
动态规划——股票买卖5
Flexible and easy to use WYSIWYG visual report
10 practical uses of NFT
【STM32】EXTI
@Detailed explanation of repository
【STM32】EXTI
DVWA full level customs clearance tutorial
Understand JS execution context in an article
What open source projects of go language are worth learning
Advanced MySQL III. storage engine