This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Resizing HTML Table Columns Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Resizing HTML Table Columns" Watch "Resizing HTML Table Columns" New topic
Author

Resizing HTML Table Columns

Naveen Ramanathan
Greenhorn

Joined: Apr 20, 2009
Posts: 8
Hi,

I found a piece of code online for resizing HTML table columns. With a little bit of changes, I was able to modify the code to suit my need. The issue is that, the functionality works fine in IE, but in FireFox, only the HTML table head gets resized and not the entire column. Could anyone help me figure out what could be causing this issue?

Note: Uncomment the line "obRight = ob.nextElementSibling;" for Firefox and comment out "obRight = ob.nextSibling;". Vice-Versa in IE.



Thanks
Naveen


-Naveen
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

I tried your code after uncommenting
and commenting
and nothing is happening in my Firefox on moving the mouse over the table headings. Whatever you are trying to do can be done easily (with no need to change the code according to browsers) using jQuery or any other such javascript libraries...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Naveen Ramanathan
Greenhorn

Joined: Apr 20, 2009
Posts: 8
Hi Ankit,

Thanks for the reply. I managed to find a solution to the problem. It looks like Firefox doesn't recognize the overflow:hidden property on either of TD or TH tags (or maybe ignores it). The workaround would be to enclose the contents of the td or the th within a div and then apply the overflow:hidden property to it. That seems to do the trick.

Also, I found a webpage that has a demo and a script to perform table resizing. It works fine in IE and FF.

http://bz.var.ru/comp/web/resizable.html

Thanks
Naveen
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Resizing HTML Table Columns
 
Similar Threads
Error comes whilke compiling the jsp page
JavaScript Calendar Popup
Need help with Positioning Auto complete div using AJAX and Javascript
Struts2 variable inside javascript
pass jstl value to javascript