Ver Mensaje Individual
  #10 (permalink)  
Antiguo 21/06/2003, 12:15
Avatar de caricatos
caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Hola otra vez:

No sé si es lo que quieres, pero prueba con esto:

<html>
<head >
<script language=javascript>
function ini() {
var ancho = document.getElementById("control").clientWidth;
var alto = document.getElementById("control").clientHeight;

var elemento = document.getElementById("descontrol").style;
elemento.margin = 0;
elemento.padding = 0;
imag = document.getElementById("imagen");
imag.src = "cutline.jpg";
imag.width = ancho;
imag.height = alto;

}
</script>
</head>
<body onload='setTimeout("ini()", 3000)'>
<table style="background-color: yellow">

<tr>
<td id=control style="border-style: solid">
Hola
</td>
</tr>

<tr>
<td id= descontrol style="border-style: solid">
<img id=imagen src="">
</td>
</tr>

</table>
</body>
</html>

Le puse un retardo para que se note la diferencia, pero debería quitarse.

Para netscape no funciona clientWidth, pero sí offsetWidth, aunque añado unos puntos a la anchura real.

Bueno, espero que te sirva.

Saludos