如何修正桌子高度? [英] How to fix the table height?

查看:137
本文介绍了如何修正桌子高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将表格高度固定为600像素,如果内容太长,则为前夕。

I want to fix the table height to 600px, eve if the content goes long.

推荐答案

a div 标签,并设置 div 的CSS属性,如下所示:

Try wrapping the table within a div tag, and setting the CSS properties of the div like so:

div.tablewrapper {
    height: 600px;
    overflow-y: auto;
}

如果表的高度超过600像素,如果你不想总是强制高度为600px,如果表太小,占用太多的空间,而是只需要600px是 max ,使用 max-height 而不是 height

This will make a scrollbar appear if the table's height exceeds 600 pixels. If you don't want to always force the height to 600px if the table it too small to take up that much space, but instead just want 600px to be the max, use max-height instead of height.

这篇关于如何修正桌子高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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