html - IOS设备上的表格不能滚动?
问题描述
我目前正在处理一个 html 表,这就是我目前所拥有的:
<table class='table' id="intern_table" style='display: block; overflow-x: auto; white-space: nowrap;' >
<thead>
<tr id="intern_table_title" style="color: black">
<th scope="col" class='text-center'>Industry Category</th>
<th scope="col" class='text-center'>Name</th>
<th scope="col" class='text-center'>Job Category</th>
<th scope="col" class='text-center'>Job Name</th>
<th scope="col" class='text-center'>Job Location</th>
<th scope="col" class='text-center'>Deadline</th>
<th scope="col" class='text-center'>hits</th>
</tr>
</thead>
<tbody>
....
</tbody>
</table>
由于我想让表格中的元素不改变行,这意味着如果发生溢出,我想让它可滚动,所以我将它添加到表格元素中:
<style='display: block; overflow-x: auto; white-space: nowrap;'>
它可以在除 IOS 系统之外的所有不同设备上成功运行。另外,我尝试将 to 修改overflow-x: auto
为overflow-x:touch
,但该表仍然无法在 IOS 设备上滚动。关于如何解决这个问题的任何想法?提前致谢。
解决方案
请添加以下CSS并检查它是否有效
<style>
table
{
overflow-x: scroll;
}
</style>
有用的链接:https ://community.grafana.com/t/grafana-5-overflow-scroll-doest-work-on-mobile/5480/5
推荐阅读
- arm - 为什么 Eclipse CDT Indexer 不索引正确的配置?
- java - 从请求中获取 Keycloak auth-server-url?
- c++ - 当仅影响静态方法时,如何解决 C++ 中的链接器错误?
- gitlab - 时间:一些分支机构的手册
- r - 如何在 R 统计中结合两个函数?
- android - 在 Android Studio 中使用 Kotlin 构建一个简单的 MediaPlayer。无法获取要流式传输的 URL 数据源
- visual-studio - I'm getting a package Microsoft.Build 16.3.0 is not compatible with netstandard 2.0 error
- javascript - 在 ASP.NET MVC 中为 GridView 创建动态工具提示
- analysis - Zeek (Bro) 根据输入文件重命名日志
- django - 列出 Django Rest Framework 序列化程序中所需字段的名称(并忽略父字段)