html - 在 Bootstrap 4 中设备较小时固定表列
问题描述
我正在使用 Bootstrap 4 Table 制作表格。
<div class="col-12">
<table class="table">
<thead>
<tr id="mes">
<th scope="col">column 1</th>
<th scope="col">column 2</th>
<th scope="col">column 3</th>
<th scope="col">column 4</th>
<th scope="col">column 5</th>
<th scope="col">column 6</th>
<th scope="col">column 7</th>
<th scope="col">column 8</th>
<th scope="col">column 9</th>
<th scope="col">column 10</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" style="">Name 1</th>
<td class="table-success">OKAY</td>
<td class="table-success">OKAY</td>
<td class="table-success">OKAY</td>
<td class="table-success">OKAY</td>
<td class="table-success">OKAY</td>
<td class="table-success">OKAY</td>
</tr>
<tr>
<th scope="row">Name 2</th>
</tr>
<tr>
<th scope="row">Name 3</th>
</tr>
<tr>
<th scope="row">Name 4</th>
<td class="table-success">OKAY</td>
<td class="table-success">OKAY</td>
<td class="table-success">OKAY</td>
</tr>
</tbody>
</table>
</div>
当屏幕很小(如智能手机)时,我试图固定第一列。如果用户向下/向上滚动,第一列也会滚动。但是如果用户向左/向右滚动,第一列将被固定,其余列将滚动。任何人都可以帮助我吗?
我试图用最好的方式解释,希望你能理解
对不起我的英语不好
解决方案
推荐阅读
- bbc-microbit - Microbit 音乐/滚动输出损坏内存?
- python - 在 Python 中使用按钮打开带有图像的窗口
- python - 根据密度增加点的颜色
- c - 如何从 C 语言头文件中检索类型、变量、宏等的真实定义?
- java - 添加数据时,我需要从 firebase 数据库快速刷新数据
- javascript - 将 javascript 数字转换为浮点数(单精度 IEEE-754)并接收整数位
- jquery - 在 asp.net 核心中使用 ajax 调用下载文件的问题
- sql-server - 启动、停止和重新启动服务菜单选项被禁用
- c++ - C++ 中全图的优化(内存)实现
- ubuntu - 如何修复 INET 错误“无法加载库”