• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

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

aceO07

Diamond Member
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'.
 
Figured it out.

$('div_id).getElementsBySelector('table').down('tr').childElements()
Then a .getWidth for each child.
 
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.
 
Back
Top