Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/03/2003, 07:49
furoya
(Desactivado)
 
Fecha de Ingreso: noviembre-2002
Ubicación: Ciudad Autónoma de Buenos Aires
Mensajes: 2.367
Antigüedad: 21 años, 6 meses
Puntos: 317
Ah...

¿Y no era más fácil preguntar cómo se ajusta el fondo de la tabla con una imagen...?. No es que haya un método eficaz, pero de haber preguntado ésto en el foro de HTML, seguro te hubieran pasado algún truco.

Pero como estamos en el foro de Javascript:

Código:
<html> 
<head> 
<title> AJUSTA IMAGEN.</title> 
<SCRIPT>
<!-- 
function tam(){
if(document.all){tabla.style.fontSize=fuenteT.value+'pt';
tabla.style.fontFamily=fuenteF.value;
tabla.style.lineHeight=fuenteE.value;
alto=tabla.offsetHeight;
ancho=tabla.offsetWidth;
imagen.style.height=alto;
imagen.style.width=ancho;
imagen.style.top=-alto;}
}
// --> 
</SCRIPT> 
</HEAD> 
<BODY onload=tam()>
<H2>La imagen se ajusta al tamaño de la tabla.</H2>
Cambiá el formato del texto y hacé <i>click</i> en <b>Ver</b>.<p>

Tamaño : <input size=3 name=fuenteT value="16">pt ; 
Familia : <select name="fuenteF"> 
<option value="monospace">monospace
<option selected value="serif">serif
<option value="sans-serif">sans-serif
<option value="fantasy">fantasy
</select> ; 
Espaciado : <input size=3 name=fuenteE value="1"> ; 
&nbsp; <button onmouseup=tam()>Ver</button><p>

<table id=tabla style="display:inline;color:#aa4400" border=1>
<td><b>qwertyuiop <br>QWERTYUIOPQWERTYUIOPQWERTYUIOP<br>
asdfghjklñ</b></td>
</table><br>
<img border=1 id=imagen style="position:relative;z-index:-1;" 
src="http://www.forosdelweb.com/images/a/logo_header.gif" ><br>

<b>NOTA</b> : Tampoco estoy seguro de que funcione fuera del <b>IE</b>.
</BODY> 
</HTML>
Perdón por haber demorado tanto en leer tu mensaje. Es que no me conecto muy seguido.