表里面的div溢出 [英] table inside div overflowing

查看:93
本文介绍了表里面的div溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常基本的css问题。
我有一个固定高度的div,我有一个表里面的div。

I have a very basic css question. I have a div with fixed height and I have a table inside that div.

表的内容将不适合div,除非div滚动条。现在的问题是,
表的内容溢出div,因为它的高度大于我在div上设置的高度。

The content of the table will not fit in the div unless the div gets a scrollbar. The problem is now, the content of the table is overflowing the div as its height is more than the height I set on the div.

这是什么我有Div

 display: inline-block;
    float: left;
    max-height: 200px;

以下是一个示例。

a href =http://jsfiddle.net/LNS26/58/ =nofollow> jsfiddle

jsfiddle

如何获取表格适合在div和有滚动条?这不是特定于任何浏览器。

How do I get the table to fit in the div and have a scrollbar? This is not specific to any browser. I tried both in Chrome and IE myself.

推荐答案

[编辑]引用您的请求: p>

[edit] Quoting your request:


如何使表格符合div 并具有滚动条

将以下内容添加到 .test 小提示

overflow-y:scroll;

overflow-y

这篇关于表里面的div溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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