Connecting Tech Pros Worldwide Help | Site Map

synchronizing 2 tables' columns width

abs
Guest
 
Posts: n/a
#1: Jul 23 '05
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


Evertjan.
Guest
 
Posts: n/a
#2: Jul 23 '05

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)

abs
Guest
 
Posts: n/a
#3: Jul 23 '05

re: synchronizing 2 tables' columns width


Evertjan. wrote: [...]

Big thanks !
ABS


Closed Thread


Similar JavaScript / Ajax / DHTML bytes