处理表中的溢出
如果我有一个像这样非常非常简单的例子:
table {
table-layout:fixed;
width:300px;
}
.td1 {
width:100px;
}
.td2 {
width:200px;
}
并且在我的一个 .td2
中包含一个图像,可以说,宽度为
300px
代码>.我想显示滚动条以允许用户滚动以查看全部内容。但我认为这是不可能的,是吗?
所以我的问题是:
除了
hidden
之外,还有其他选项用于处理表中的溢出吗?是否可以仅当内容超出设定宽度时才显示滚动条? (我发誓我在一些论坛软件中见过它,但我不记得是哪一个)
If I have a table like this very very simple example:
table {
table-layout:fixed;
width:300px;
}
.td1 {
width:100px;
}
.td2 {
width:200px;
}
and in one of my .td2
contains an image that is, lets say, 300px
in width
. I would like to show scroll bars to allow users to scroll to see it all. However I don't think this is possible, is it?
So my questions are:
Are there any other options apart from
hidden
for handling overflow in tables?Is it possible to show scroll-bars only when content pushes beyond a set width? (I swear I've seen it in some forum software but I can't remember which one)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样
将图像放入表格单元格的 div 内,并使 div 的宽度和高度为 td 的 100%,并将其样式设置为溢出:auto
What about
Put the image inside a div in the table cell and make the width and height of the div to be 100% of the td and style it to overflow: auto