html原生表格,实现左侧列固定

css类实现

css 复制代码
tr:nth-child(even) {
    background-color: rgb(248, 247, 246);
}
tr:nth-child(odd) {
    background-color: #fff;
}
.dm_d1 {
    min-width: 0.2rem;
    position: sticky;
    left: 0;
    background: inherit;
}
.dm_d2 {
    width: 6vw;
    position: sticky;
    left: 2.25vw;
    background: inherit;
}
.dm_d3 {
    width: 3vw;
    position: sticky;
    left: 8.2vw;
    background: inherit;
}
.dm_d4 {
    width: 18vw;
    position: sticky;
    left: 11.2vw;
    background: inherit;
}
.dm_d5 {
    width: 4vw;
    position: sticky;
    left: 29.2vw;
    background: inherit;
}
相关推荐
Lank_M1 分钟前
MP4和WebM导出后为何起播与拖动不同
前端
用户5508492902564 分钟前
前端本地存储怎么选:Cookie、localStorage、sessionStorage、IndexedDB 的取舍
前端
用户5508492902564 分钟前
Git 日常命令与分支协作流程:从提交到合并的实战梳理
前端
修炼的dance4 分钟前
同一段视频没降画质为什么就快了
前端
asong27 分钟前
从写代码到部署上线,Cloudflare 给 AI 配了一把新钥匙
前端·javascript·后端
用户53723128824640 分钟前
你的 WGSL 从未被执行过——一个 secure context 静默陷阱的排查实录
前端
Daniel_1231 小时前
轻量级站点监控面板 LightPing 开源啦
前端·后端·github
想风1 小时前
A/B 测试怎么做?独立站转化率优化的完整实操步骤
前端·后端·github
lerhxx1 小时前
从 Markdown 到生成式 UI:AI 应用中的流式渲染实践
前端·javascript
迅猛龙办公室1 小时前
python实现简单进度条
java·前端·python