layui table 表格设置透明

本文介绍了一种使用CSS实现表格透明效果的方法。通过修改背景颜色、边框样式及文字颜色,使表格在保持功能的同时拥有更佳的视觉体验。适用于需要透明效果的网页设计。

通过css来控制,直接上代码

首先需要将table标签放入div中,div增加class名称 transparentDataTable ,如果是静态表格,则增加transparentStaticTable ,然后引入此css文件即可.

/**
   设置表透明  start====================================================================================================================
 */

.transparentDataTable .layui-table{
    background-color: transparent !important;
}
.transparentDataTable .layui-table-view{
    background-color: rgba(0, 0, 0, 0.5) !important;
}
.transparentDataTable .layui-table-tool {
    background-color: transparent !important;
}

.transparentDataTable .layui-table-tool .layui-icon {
    color: white;
}

.transparentDataTable .layui-table-header, .transparentDataTable .layui-table-cell, .layui-table-header thead tr {
    background-color: transparent !important;
}

.transparentDataTable .layui-table-header thead th, .transparentDataTable .layui-none {
    /*border: 1px solid #FFFFFF;*/
    color: white !important;
}

.transparentDataTable .layui-table tbody tr {
    border: 1px solid #FFFFFF;
    color: white;
}

.transparentDataTable .layui-table-init, .transparentDataTable .layui-laypage-limits select, .transparentDataTable .layui-laypage-btn, .transparentDataTable .layui-laypage-skip input {
    background-color: transparent !important;
    color: white;
}

.transparentDataTable .layui-table-page a, .transparentDataTable .layui-table-page span {
    color: white !important;
}


.transparentDataTable .layui-laypage-limits select, .transparentDataTable .layui-laypage-limits option {
    -webkit-appearance: none; /* google */
    -moz-appearance: none; /* firefox */
    appearance: none; /* IE */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);   /* 点击去除高亮的颜色*/
    background-color: rgba(0, 0, 0, 0.5) !important;
    color: white;
}

.transparentDataTable .layui-table[lay-even] tr:nth-child(even){
    background-color: rgba(180, 238, 180, 0.5) !important;
}


/*静态表格透明*/
.transparentStaticTable .layui-table{
    background-color: rgba(0, 0, 0, 0.5) !important;
}
.transparentStaticTable .layui-table tbody tr:hover, .statistics_branch_one .layui-table tbody tr:hover {
    background-color: transparent !important;
}

/*.statistics_table_opacity {*/
/*    background-color: rgba(0, 0, 0, 0.5) !important;*/
/*}*/

/*设置表透明  end====================================================================================================================*/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值