当前位置: 首页 > news >正文

Bootstrap 4 表头固定,tbody滚动条

 

表格

<div class="row" style="background-color: #fff;overflow: auto;max-height: 500px;">
     <table class="table table-striped table-bordered scrolltable text-nowrap">
                  <thead>
                        <tr>
                          <th scope="col">序号</th>
                            <th scope="col">备注</th>
                           <th scope="col">备注</th>
                           <th scope="col">备注</th>
                            <th scope="col">备注</th>
                            <th scope="col">备注</th>
                            <th scope="col">备注</th>
                            <th scope="col">备注</th>
                            <th scope="col">备注</th>
                            <th scope="col">备注</th>
                          </tr>
                     </thead>
                    <tbody >
                        <tr>
                           <th scope="row">1</th>
                            <td>Mark</td>
                            <td>Otto</td>
                            <td>Mark</td>
                             <td>Otto</td>
                              <td>@mdo</td>
                              <td>Mark</td>
                               <td>Otto</td>
                                <td>Mark</td>
                                <td>Otto</td>
                             </tr>
                       </tbody>
                   </table>

        </div>

CSS 

thead tr:first-child {
        background-color: #CCC; 
        position:sticky;
        top:-10px;

    }

http://www.lryc.cn/news/418109.html

相关文章:

  • MYSQL知识点(持续更新)
  • html+css网页设计 酷狗首页1个页面 (无js)
  • 用户体验至上:9款软件界面设计工具分享
  • Lambda 表达式:解锁编程世界的魔法之门
  • 【python】Pandas处理Excel表格用法分析与最佳实践
  • KL 散度(python+nlp)
  • 四种推荐算法——Embedding+MLP、WideDeep、DeepFM、NeuralCF
  • 鹏鼎控股:最新面试求职SHL逻辑测评笔试题库讲解及真题分享
  • 【Git】git 不跟踪和gitignore区别
  • 51单片机—智能垃圾桶(定时器)
  • 熵权法模型(评价类问题)
  • 用uniapp 及socket.io做一个简单聊天app 踢人拉黑 7
  • springboot项目迁移到阿里云函数
  • Java设计模式(桥接模式)
  • 【独家原创】基于APO-Transformer-LSTM多特征分类预测(多输入单输出)Matlab代码
  • 【大模型】大模型指令微调的“Prompt”模板
  • Spring的设计模式----工厂模式及对象代理
  • 【算法】浅析广度优先搜索算法
  • 分布式时序数据库TimeLyre 9.2发布:原生多模态、高性能计算、极速时序回放分析
  • PMP考试题库每日五题+答案解析
  • 机器学习用python还是R,哪个更好?
  • 【数据结构】mapset详解
  • 数据结构(邓俊辉)学习笔记】词典 02—— 散列函数
  • Python学习(1):使用Python的Dask库实现并行计算
  • 数据结构 - 哈希表
  • 电商选品这几点没做好,等于放弃80%的流量!
  • 【教程】最新可用!Docker国内镜像源列表
  • 使用RabbitMQ在Spring Boot入门实现简单的消息的发送与接收
  • 基于物联网的水质监测系统设计与实现:React前端、Node.js后端与TCP/IP协议的云平台集成(代码示例)
  • Vcpkg安装指定版本包或自定义安装包