Connecting Tech Pros Worldwide Help | Site Map

synchronizing 2 tables' columns width

  #1  
Old July 23rd, 2005, 06:36 PM
abs
Guest
 
Posts: n/a
Hi everybody.

My problem: there are two tables. Their columns' widths are set by the
content. Do you have any idea how to set the width of the second table's
columns to be the same as width of adequate columns in the first table ?

Best regards,
ABS


  #2  
Old July 23rd, 2005, 06:36 PM
Evertjan.
Guest
 
Posts: n/a

re: synchronizing 2 tables' columns width


abs wrote on 06 feb 2005 in comp.lang.javascript:
[color=blue]
> My problem: there are two tables. Their columns' widths are set by the
> content. Do you have any idea how to set the width of the second
> table's columns to be the same as width of adequate columns in the
> first table ?
>[/color]

in IE:

<table id=t1 border=1>
<tr><td>qqqqqqqqqqqqqqqqqqqqqqqqqq</td></tr>
</table>
<br><br>

<table id=t2 border=1>
<tr><td>q</td></tr>
</table>


<script >

function g(x){
return document.getElementById(x)
}

g("t2").style.width = g("t1").offsetWidth

</script>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

  #3  
Old July 23rd, 2005, 06:36 PM
abs
Guest
 
Posts: n/a

re: synchronizing 2 tables' columns width


Evertjan. wrote: [...]

Big thanks !
ABS


Closed Thread