NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page javascript table resize won't work in firefox

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 02-04-2006, 04:03 AM THREAD STARTER               #1 (permalink)
NamePros Member
Join Date: Aug 2005
Posts: 29
kareltje is an unknown quantity at this point
 



Question javascript table resize won't work in firefox


I'm trying to make a table fit into a window, it works well in IE, but doesn't work at all in Firefox. Here's my code:

function adjustHeight() {
var contsheight = document.documentElement.clientHeight;
conts.height=contsheight // conts is the table ID
}

and in the body tag:

<body background="../bggradient.jpg" onload="javascript:adjustHeight();" onresize="javascript:adjustHeight();">

my table's tag looks like this:

<table width="100%" border="0" cellpadding="0" cellspacing="0" ID="conts"">

IE does the job just fine, while Firefox doesn't do a thing. Debugging has taught me that firefox does know the "document.documentElement.clientHeight"-variable, and Firefox' Javascript Console says: "conts is not declared". I've also tried the getObjectByID function but that didn't help either.
????: NamePros.com http://www.namepros.com/programming/164350-javascript-table-resize-wont-work-firefox.html
It's not my first compatibility issue, but this time I don't know what to do with it. Anyone else know how to deal with this problem?
kareltje is offline  
Old 02-04-2006, 06:54 AM   #2 (permalink)
NamePros Regular
 
Rowan W's Avatar
Join Date: Dec 2004
Location: QLD, Australia
Posts: 713
Rowan W will become famous soon enough
 



Have you tried "height:100%" in CSS?

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html>
<head>
<title>One Hundred Percent Height</title>
<style type="text/css">
html {
  height: 100%;
}
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: #fff;
}
table {
  height: 100%;
  background-color: #69c;
}
</style>
</head>
<body>

<table>
  <tr>
    <td>table cell</td>
  </tr>
</table>

</body>
</html>
</head>
Rowan W is offline  
Old 02-04-2006, 07:53 AM THREAD STARTER               #3 (permalink)
NamePros Member
Join Date: Aug 2005
Posts: 29
kareltje is an unknown quantity at this point
 



thanks a lot, when i first tried it it didn't work but then I realised that I had to apply it to the onclosing DIV as well. now everything is working well.
Last edited by kareltje; 02-04-2006 at 07:59 AM.
kareltje is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
My footer won't reach the bottom of the page in Firefox!! will7 Programming 3 04-26-2005 11:21 PM
Portable Firefox dgridley Free Resources 2 04-03-2005 11:34 AM
Wierd FireFox problem! HELP! ChrisK76 Web Design Discussion 8 03-24-2005 07:32 AM
Willing to do work for cheap (just got scammed) iDeviseFlash For Sale / Advertising Board 5 11-07-2004 01:09 AM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 11:11 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger