| 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
|
|
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
|
 |
 |
|
|
subject: Resizing HTML Table Columns
|
|
|