Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html表格布局随着正文页面的加载而收缩_Html_Css_Apache Tiles - Fatal编程技术网

html表格布局随着正文页面的加载而收缩

html表格布局随着正文页面的加载而收缩,html,css,apache-tiles,Html,Css,Apache Tiles,我对设计html页面还不熟悉。我一整天都在寻找答案。。但是没有运气。。我无法将html页面高度调整为适合浏览器。我正在使用ApacheTiles开发网页,以进行页面布局。因此,在我的布局中,我将有页眉、正文和页脚。下面是我的tiles布局jsp <body> <table width="100%" height="100%" align="center"> <tr height="20%"> <td>

我对设计html页面还不熟悉。我一整天都在寻找答案。。但是没有运气。。我无法将html页面高度调整为适合浏览器。我正在使用ApacheTiles开发网页,以进行页面布局。因此,在我的布局中,我将有页眉、正文和页脚。下面是我的tiles布局jsp

<body>
    <table width="100%" height="100%" align="center">
        <tr height="20%">
            <td><tiles:insertAttribute name="header" /></td>
        </tr>
        <tr height="60%">
            <tiles:insertAttribute name="menu" ignore="true" />
            <td align="left">
                    <tiles:insertAttribute name="body" />
                </td>
        </tr>
        <tr height="20%">
            <td><tiles:insertAttribute name="footer" /></td>
        </tr>
    </table>
</body>
我想用百分比设计我的页面,我不想在不同的屏幕分辨率上使用像素来缩放问题

当我加载页面时。。表格高度相对于正文页内容大小缩小。。例如,如果我的正文页大小为两行。然后我的页脚向上移动(看起来很奇怪)。我想修正页眉,正文和页脚分别为20%,60%和20%,这应该是固定的


提前谢谢

这里有您的桌子。给他们一个高度,他们会尽力让他们的内容适合你的高度。因此,在总内容高达120%的情况下,您所期望的内容与表生成的内容之间必然存在一些冲突。解决方案:要么让表格自己计算尺寸,要么给它一些不可能的东西。对不起,是20%60%20%和打字错误..好的,但有两个打字错误。编辑后,您的问题中仍有20%80%20%。但您的问题现在解决了吗?现在高度还可以,对吗?我根据你的代码制作,它显示了表格行的正确高度比。非常感谢李斯特先生。。现在可以用了。。我确实错过了html高度参数。。加上这个。。它起作用了。。
body {
background-color: #f0f0f0;
width: 100%;
height: 100%;
margin: 0%;
padding: 0%;
}

table {
table-layout: fixed;
overflow: auto;
}