Forum Moderators: not2easy

Message Too Old, No Replies

Tables within a Div

The div won't resize ....

         

Nicky

10:23 am on Mar 2, 2004 (gmt 0)

10+ Year Member



I've got a table within a div (within a div). I use the List apart hack to fix the footer problem across different browsers. All works well but on Mozilla if the div contains a table it messes things up and won't detect that the div should be longer. So the footer appears at the top of the page.

Does anyone know how to detect that the div should be longer due to the table.

I currently use this hack to get the footer to resize


function setFooter() {
if (document.getElementById) {
var windowHeight = getWindowHeight();
if (windowHeight > 0) {
if (document.getElementById('norm')) {
var cHeight = document.getElementById('norm').offsetHeight;
} else {
var cHeight = document.getElementById('container').offsetHeight;
}
var footerElement = document.getElementById('footer');
var footerHeight = footerElement.offsetHeight;
if (windowHeight - (cHeight + footerHeight) >= 0) {
footerElement.style.top = (windowHeight - (cHeight+footerHeight)) + 'px';
}
else {
footerElement.style.position = 'static';
}
}
}
}

I'm really stuck on this so any help would be greatly appreciated.. Thanks

DrDoc

5:12 pm on Mar 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What does the CSS for the div look like?