Forum Moderators: not2easy
I google some useful stuff from this form, but it did not work for my purpose entirely. Here is the example, the content is very long, it's just for testing.
my problem here,
If the table has many rows, the footer doesn't display at the windows bottom.
what I wannted is, if the table has many stuff, the div(contain the table) has the scrollbar, the footer is still at the bottom of the window, no matter I changed the size of the window.
Ideas are appreciated.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
html, body{height: 100%; width: 100%; border: 0; padding: 0; margin: 0; background: #fcc;}
#spacer{
display: block;
height: 95%;
width: 1px;
padding: 0;
margin: 0;
border: 0;
background: #fff; /* same as body bg */
float: right;
}
#bodycontent {
width: 100%;
margin: 0;
padding: 0;
border: 0;
float: right;
margin-right: -1px; /* this is the key to avoid the 1px jog caused by spacer */
}
#bodyarea{
margin: 0px;
background: #fcc;
padding-top: 50px;
width: 100%;
}
#leftcol{float:left; width: 20%;}
#rightcol{float:left; width: 20%;}
#centercol{float:left; width: 100%; overflow:auto;background: #ffe;}
#centercol h4{ width: 100%; background: yellow; text-align: center;}
#centercol p{padding: 10px;}
#footer{
display: block;
clear: both;
width: 100%;
padding: 0;
margin: 0;
background: #ddd;
text-align: center;
margin-right: 0px;
}
#footer p{background: #ddd;}
#header{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 50px;
background: purple;
color: white;
z-index: 50;
}
#leftmenu{
position: absolute;
top: 100px;
left: 0px;
width: 20%;
background: #ccc;
}
#rightmenu{
position: absolute;
top: 150px;
right: 0px;
width: 20%;
background: #ccc;
}
img{display: block;}
</style> </script> [1][edited by: tonyutada at 10:01 am (utc) on Dec. 5, 2006]
</head>
<script type='text/javascript'>
<!--
window.resizeTo(500,300);
window.moveTo(86,46);
var MainWindow=window.open('','MainS67b3418c4f4a47a99b1a79c18a8bf817');
var winMan=MainWindow.frames;
winMan.AddWindow(self);
//-->
<body>
<div id="spacer">
</div>
<div id="bodycontent">
<div id="bodyarea">
<div id="centercol">
<table border='0' cellpadding='0' cellspacing='0' width='1600' style='table-layout: auto;
background-color: white;'>
<tr>
<th class="GridHead" style='cursor: hand; white-space: nowrap; background-color: Silver;
width: 200px;' onclick="FireWithValue('Cd1183492b2c84ab4ba33bb7ef5ef5198','FID');">
Fid</th>
<th class="GridHead" style='cursor: hand; white-space: nowrap; background-color: Silver;
width: 200px;' onclick="FireWithValue('Cd1183492b2c84ab4ba33bb7ef5ef5198','FID_PARENT');">
fid_parent</th>
<th class="GridHead" style='cursor: hand; white-space: nowrap; background-color: Silver;
width: 200px;' onclick="FireWithValue('Cd1183492b2c84ab4ba33bb7ef5ef5198','LABEL_DEF_ID');">
label_def_id</th>
<th class="GridHead" style='cursor: hand; white-space: nowrap; background-color: Silver;
width: 200px;' onclick="FireWithValue('Cd1183492b2c84ab4ba33bb7ef5ef5198','ORIGIN');">
origin</th>
<th class="GridHead" style='cursor: hand; white-space: nowrap; background-color: Silver;
width: 200px;' onclick="FireWithValue('Cd1183492b2c84ab4ba33bb7ef5ef5198','LABEL_TEXT');">
label_text</th>
<th class="GridHead" style='cursor: hand; white-space: nowrap; background-color: Silver;
width: 200px;' onclick="FireWithValue('Cd1183492b2c84ab4ba33bb7ef5ef5198','ORIENTATION');">
Orientation</th>
<th class="GridHead" style='cursor: hand; white-space: nowrap; background-color: Silver;
width: 200px;' onclick="FireWithValue('Cd1183492b2c84ab4ba33bb7ef5ef5198','PRE');">
pre</th>
<th class="GridHead" style='cursor: hand; white-space: nowrap; background-color: Silver;
width: 200px;' onclick="FireWithValue('Cd1183492b2c84ab4ba33bb7ef5ef5198','SUF');">
suf</th>
</tr>
<tr style='cursor: default;'>
<td class="GridItem" style='white-space: nowrap;'>
<input type="text" readonly="readonly" style='width: 100%; font-family: arial; font-size: xx-small;
text-align: right; background: buttonface;' name='Cffac1160515d445699740e63565c4428'
onmousedown="mnu_Caef217bb356b4a2e89853fcbca08dd05_Show(this,event,event.button,event.clientX,event.clientY);"
value='10833' />
</td>
<td class="GridItem" style='white-space: nowrap;'>
<input type="text" ondblclick="Fire('Ccb770fde8d664c1f940d6b77dcfe333e');" readonly="readonly"
style='width: 100%; font-family: arial; font-size: xx-small; z-index: 1000;' name='C80e3912822b44d36a2be668214f66668'
value='9435' onmousedown="mnu_Cd59889502bfb4a9fb663c1a59cdc14de_Show(this,event,event.button,event.clientX,event.clientY);" />
</td>
<td class="GridItem" style='white-space: nowrap;'>
<input type="text" readonly="readonly" style='width: 100%; font-family: arial; font-size: xx-small;
text-align: right;' name='C02e88f7b00674774b76ffa8ad560aa9d' onmousedown="mnu_Caef217bb356b4a2e89853fcbca08dd05_Show(this,event,event.button,event.clientX,event.clientY);"
value='10000' />
</td>
<td class="GridItem" style='white-space: nowrap;'>
<input type="text" readonly="readonly" style='width: 100%; font-family: arial; font-size: xx-small;
text-align: right;' name='Cd4e3f6ff0bcc4844948ea836fd67ff02' onmousedown="mnu_Caef217bb356b4a2e89853fcbca08dd05_Show(this,event,event.button,event.clientX,event.clientY);"
value='8' />
</td>
<td class="GridItem" style='white-space: nowrap;'>
<input type="text" readonly="readonly" style='width: 100%; font-family: arial; font-size: xx-small;'
name='C3323ad2914f54d639ec81d132784a3d0' onmousedown="mnu_Caef217bb356b4a2e89853fcbca08dd05_Show(this,event,event.button,event.clientX,event.clientY);"
value='13A' />
</td>
<td class="GridItem" style='white-space: nowrap;'>
<input type="text" readonly="readonly" style='width: 100%; font-family: arial; font-size: xx-small;
text-align: right;' name='C8fda3c8d43484de6948473adb7963d4d' onmousedown="mnu_Caef217bb356b4a2e89853fcbca08dd05_Show(this,event,event.button,event.clientX,event.clientY);"
value='50.600' />
</td>
<td class="GridItem" style='white-space: nowrap;'>
<input type="text" readonly="readonly" style='width: 100%; font-family: arial; font-size: xx-small;'
name='C3b60778312f3432ca7881b986304da8f' onmousedown="mnu_Caef217bb356b4a2e89853fcbca08dd05_Show(this,event,event.button,event.clientX,event.clientY);"
value='' />
</td>
<td class="GridItem" style='white-space: nowrap;'>
<input type="text" readonly="readonly" style='width: 100%; font-family: arial; font-size: xx-small;'
name='C65bb45d9d63c43048973e46cc8a78bfb' onmousedown="mnu_Caef217bb356b4a2e89853fcbca08dd05_Show(this,event,event.button,event.clientX,event.clientY);"
value='' />
</td>
</tr>
<tr style='cursor: hand;' onclick="FireWithValue('C3310df6893d340e78c9e26f6cf5d1c08','2');">
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10834</td>
<td class="GridItem" style='white-space: nowrap;'>
9436</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10000</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
18</td>
<td class="GridItem" style='white-space: nowrap;'>
n.n.</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
45.400</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
</tr>
<tr style='cursor: hand;' onclick="FireWithValue('C3310df6893d340e78c9e26f6cf5d1c08','3');">
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10835</td>
<td class="GridItem" style='white-space: nowrap;'>
9437</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10000</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
18</td>
<td class="GridItem" style='white-space: nowrap;'>
22</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
45.800</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
</tr>
<tr style='cursor: hand;' onclick="FireWithValue('C3310df6893d340e78c9e26f6cf5d1c08','4');">
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10836</td>
<td class="GridItem" style='white-space: nowrap;'>
9438</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10000</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
8</td>
<td class="GridItem" style='white-space: nowrap;'>
6E</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
186.100</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
</tr>
<tr style='cursor: hand;' onclick="FireWithValue('C3310df6893d340e78c9e26f6cf5d1c08','5');">
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10837</td>
<td class="GridItem" style='white-space: nowrap;'>
9439</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10000</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
18</td>
<td class="GridItem" style='white-space: nowrap;'>
12</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
32.600</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
</tr>
<tr style='cursor: hand;' onclick="FireWithValue('C3310df6893d340e78c9e26f6cf5d1c08','6');">
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10838</td>
<td class="GridItem" style='white-space: nowrap;'>
9440</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10000</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
8</td>
<td class="GridItem" style='white-space: nowrap;'>
10</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
132.600</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
</tr>
<tr style='cursor: hand;' onclick="FireWithValue('C3310df6893d340e78c9e26f6cf5d1c08','7');">
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10839</td>
<td class="GridItem" style='white-space: nowrap;'>
9441</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10000</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
8</td>
<td class="GridItem" style='white-space: nowrap;'>
8</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
132.700</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
</tr>
<tr style='cursor: hand;' onclick="FireWithValue('C3310df6893d340e78c9e26f6cf5d1c08','8');">
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10840</td>
<td class="GridItem" style='white-space: nowrap;'>
9442</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
10000</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
8</td>
<td class="GridItem" style='white-space: nowrap;'>
6</td>
<td class="GridItem" style='white-space: nowrap; text-align: right;'>
132.600</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
<td class="GridItem" style='white-space: nowrap;'>
</td>
</tr>
</table>
</div>
</div>
<!-- bodyarea -->
</div>
<!-- bodycontent -->
<div style="clear: both;">
</div>
<!-- to clear the floats - might not be required -->
<div id="footer">
<p>
footer text</p>
</div>
<div id="header">
Header Text</div>
</body>
if i set the footer div as the {position:absolute;bottom:0px} , the footer will be at the bottom of the window. But in case of I changing the window, the footer could overlap the upper content(upper div).
Here's an example creating a frames effect:
[cssplay.co.uk...]