Solved

Dynamic Column Resize

Posted on 2002-03-13
4
587 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hta File displays dynamic File names 4 65
Add Rows on a Table 8 52
close window in firefox 3 37
Leaflet map example works but I want to make a change to it 5 27
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

734 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