Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/11/2011, 14:02
augusto_jaramil
 
Fecha de Ingreso: junio-2004
Ubicación: Ciudad de Panama
Mensajes: 551
Antigüedad: 19 años, 10 meses
Puntos: 8
Pregunta No logro ver la imagen....

Hola a tod@s,

Con este código

Código PHP:
<html>
<
head>
<
script type="text/javascript">

function 
crearCell(par){
    var 
x=document.getElementById('myTable');
    var as = 
x.getElementsByTagName('td');
    var 
y=x.rows[0].insertCell(par);
    as[
par].id="nuevo";
    
darAtributosBtn(as[par].id);
}

function 
darAtributosBtn(i) {
    
celda document.getElementById(i);
    
celda.setAttribute("type","img");
    
celda.setAttribute("src","./gif/tool_add.gif");
    
celda.setAttribute("width","15px");
    
celda.setAttribute("height","15px");
    
celda.setAttribute("onClick","alerta();");
}

function 
alerta() {
   
alert("LLEGO");
}
</script>
</head>

<body>
<form>
<table id="myTable" border="1">
<tbody>
<tr>
<td id="uno">Celda uno<img src="./gif/tool_add.gif" onClick="crearCell(1);"></td>
<td id="dos">Celda dos</td>
</tr>
</tbody>
</table>
</form>
</body>
</html> 
La idea es insertar una celda entre las dos existentes. Esta nueva celda ha de contener una imagen. La celda efectivamente se crea, es mas, haciendo click en el espacio que me crea (nueva celda) se activa la función alertar.... Solo me falta ver la imagen

Colo lo hago?

Gracias de antemano por su ayuda

Un Cordial Saludo