Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 590
  • Last Modified:

Dynamic Column Resize

I am looking for examples of how to dynamically resize html table columns.  Code or links would be great.

-bb
0
xlr8tn
Asked:
xlr8tn
1 Solution
 
AlfaNoMoreCommented:
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
 
xlr8tnAuthor Commented:
Thanks,
I am currently using IE6.0 and Netscape 6.2 so it should work.  I'll give it a try.
0
 
ahosangCommented:
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
 
moduloCommented:
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now