HTML - 启用表格单元格内的滚动

标签 html scroll html-table cell

假设我有一个固定宽度和高度的表格单元格....我有超过单元格固定尺寸的数据...

<td width="500" height="300">lots of data that exceeds the dimensions</td>
  • 我可以在单元格中启用此数据的滚动....
  • 如果不是解决方案是什么..我只有那个500 x 300空间

最佳答案

最简单的方法是添加一个 500 x 300 的 div 并给它 overflow: auto

<td width="500" height="300">
 <div style="width: 500px; height: 300px; overflow: auto">
  lots of data that exceeds the dimensions
 </div>
</td>

关于HTML - 启用表格单元格内的滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3537734/

相关文章:

html - 100% 高度在下拉菜单中不起作用

css - 向左浮动移动到错误的地方

ios - 防止 UICollectionView 中每个 UICollectionViewCell 中的内容在我滚动时发生变化?

javascript - 表格不断调整大小而不溢出

php - mySQL、PHP、带有可排序列的 HTML 表 - 但某些列值存在问题

html - 垂直对齐 div 类 ="row"中的内容

html - css 固定位置页脚打印

javascript - 将 Iframe 放入 div 容器中

javascript - UIWebView滚动时调用方法

html - 如何使 <td> 与相邻的 <td> 重叠