jquery实现表格的全选复选框功能1

该博客介绍了如何利用jQuery来实现表格中的全选复选框功能。首先展示了实现后的效果图,接着在HTML部分创建了表格及复选框结构,并通过CSS进行了样式设置。然后在JS部分编写了jQuery代码,实现当全选复选框被选中时,所有行的复选框也会被选中,反之则取消选中。
摘要由CSDN通过智能技术生成

在这里插入图片描述效果图

html + css

<style>
    .red {
     
        color: red;
    }

    .tab-title {
     
        width: 100%;
        height: 40px;
        padding-bottom: 8px;
        display: flex;
    }

    .tckc {
     
        background-color: #4CAF50;
    }

    .tab-title span {
     
        line-height: 40px;
        width: 49%;
        text-align: center;
        font-size: 18PX;
        font-weight: bold;
        color: #fff;
    }

    .kecheng-tc {
     
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }

    .pagination {
     
        display: inline-block;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        margin: 20px auto;
    }

    .pagination a {
     
        color: black;
        float: left;
        padding: 8px 16px;
        text-decoration: none;
    }

    .pagination a.active {
     
        background-color: #4CAF50;
        color: white;
        border-radius: 5px;
    }

    .pagination a:hover:not(.active) {
     
        background-color: #ddd;
        border-radius: 5px;
    }

    .gwtj {
     
        position: fixed;
        bottom: 0;
        left: 50%;
        padding: 7px;
        font-size: 16px;
        transform: translateX(-50%);
        background-image: -webkit-linear-gradient(45deg, #3BD4C1, #119BD2);
        background-image: linear-gradient(45deg, #3BD4C1, #119BD2);
        z-index: 101;
        border: 1px solid #f5f5f5;
    }

    .bgRed {
     
        background: #F1F1F1;
    }

    table tbody {
     
        width: 1180px;
        display: block;
        height: 80px;
        overflow-y: scroll;
        overflow-x: hidden;
    }

    .kctc-table tbody {
     
        width: 1180px;
        height: 500px;
        background-color: #fff;
        color: #666;
        overflow-y: scroll;
    }

    .kctc-table tbody tr {
     
        width: 1180px;
        display: flex;
    }

    .kctc-table td {
     
        flex: 1;
        border: 1px solid #f5f5f5;
        min-height: 40px;
        line-height: 40px;
        font-size: 15px;
        color: #666;
    }

    .kctc-table tr td:nth-child(2) {
     
        flex: 4;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .gw-uls {
     
        display: flex;
        width: 98%;
        flex-wrap: wrap;
        margin: auto;
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值