Need Javascript help. To go through table and get column widths.

aceO07

Diamond Member
Nov 6, 2000
4,491
0
76
I'm doing a drag/drop with table rows. However, since drag/drop doesn't work with table rows, I going to use divs to resemble the table. BUT, tables are great for dynamically setting the right size for columns, which divs can't.

I want to create a js function that will go to a specific element by id, which contains a table and navigate the first row and return the widths of each of the columns in an array. Using these widths, I will construct a set of divs that will look like the original table.

I'm using Prototype framework too. If anybody have any help or bits of code, that'd be much appreciated.

'SOLVED'.
 

aceO07

Diamond Member
Nov 6, 2000
4,491
0
76
Figured it out.

$('div_id).getElementsBySelector('table').down('tr').childElements()
Then a .getWidth for each child.
 

Chosonman

Golden Member
Jan 24, 2005
1,136
0
0
You using the prototype JS framework? That doesn't look like normal javascript syntax
 

aceO07

Diamond Member
Nov 6, 2000
4,491
0
76
How would I do that same with the $$ selector?

I admit I probably need to read up on prototype, just haven't had much free time.