Solved

Dynamic Column Resize

Posted on 2002-03-13
4
576 Views
Last Modified: 2008-02-01
I am looking for examples of how to dynamically resize html table columns.  Code or links would be great.

-bb
0
Comment
Question by:xlr8tn
4 Comments
 
LVL 9

Accepted Solution

by:
AlfaNoMore earned 50 total points
ID: 6861362
var objTable = document.getElementById('name');
var firstCol = objTable.rows[0];
var objCells = firstCol.cells;
for(i=0; i<objCells.length; i++){
    objCells[i].width = 25;
}

Now, this is DOM 3 specific, but there are some IE 5.5 alterations that can be applied. Unfortunately NN4.7 or less is unable to reference a table as an object, so there's no hope for it. NN6 uses DOM 3, so the above code will work.

I'm off home now, but sure someone could provide an IE 5.5 equivalent?
0
 

Author Comment

by:xlr8tn
ID: 6862956
Thanks,
I am currently using IE6.0 and Netscape 6.2 so it should work.  I'll give it a try.
0
 
LVL 12

Expert Comment

by:ahosang
ID: 8076350
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

points to AlfaNoMore
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ahosang
EE Cleanup Volunteer
0
 

Expert Comment

by:modulo
ID: 8139795
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now