向 HTML 表格添加水平滚动条 [英] Add a horizontal scrollbar to an HTML table

查看:90
本文介绍了向 HTML 表格添加水平滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法向 HTML 表格添加水平滚动条?我实际上需要它可以垂直和水平滚动,具体取决于表格的增长方式,但我无法显示任何一个滚动条.

Is there a way to add a horizontal scrollbar to an HTML table? I actually need it to be scrollable both vertically and horizontally depending on how the table grows but I cannot get either scrollbar to appear.

推荐答案

您是否尝试过 CSS overflow 属性?

Did you try CSS overflow property?

overflow: scroll; /* Scrollbar are always visible */
overflow: auto;   /* Scrollbar is displayed as it's needed */

更新
正如其他用户指出的那样,这还不足以添加滚动条.
因此,请查看下方的评论和答案并为其点赞.

UPDATE
As other users are pointing out, this is not enough to add the scrollbars.
So please, see and upvote comments and answers below.

这篇关于向 HTML 表格添加水平滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆