【发布时间】:2017-01-14 23:34:57
【问题描述】:
很抱歉,如果这个问题已经得到回答,但是搜索“100% 高度”的东西有点困难。
我的问题是我需要 100% 高度的表格布局,因为浏览器会自动调整单元格大小,出于明显的原因我不想自己编写脚本。
它与其他“100% 问题”不同,因为我需要一些单元格贴在顶部和一些底部,并通过浏览器调整中间大小以填充剩余空间。
这种工作,当我需要中间部分包含溢出的东西时,问题就发生了,显然我想要溢出:自动让用户通过这些东西。它在 WebKit 中工作,在 Firefox 中,它没有,其他人没有测试。这是测试用例。
<html>
<head>
<style>
body, html {
height: 100%;
margin: 0;
padding: 0;
}
table {
height: 100%;
width: 200px;
border: 0;
}
.fill {
background-color: red;
}
.cont {
overflow: auto;
height: 100%;
}
</style>
</head>
<body>
<table>
<tr>
<td style="height:50px"></td>
</tr>
<tr>
<td style="height:100px"></td>
</tr>
<tr>
<td class="fill">
<div class="cont">
An opaque handle to a native JavaScript object. A JavaScriptObject cannot be created directly. JavaScriptObject should be declared as the return type of a JSNI method that returns native (non-Java) objects. A JavaScriptObject passed back into JSNI from Java becomes the original object, and can be accessed in JavaScript as expected
</div>
</td>
</tr>
<tr>
<td style="height:100px"></td>
</tr>
</table>
</body>
【问题讨论】:
-
我认为您需要重新表述您的问题。现在听起来好像你在说,“我想实现 X,所以我必须使用 Y .. 我怎样才能让 Y 工作?”我认为您应该问“我想实现 X .. 实现我的目标的最佳方式是什么”。
-
多年后,这仍然没有解决:(
标签: html css layout html-table