Ver Mensaje Individual
  #9 (permalink)  
Antiguo 22/04/2009, 21:03
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Como hacer esto con Divs, CSS y JavaScript

Que el contenido sea dinámico no tiene nada que ver, sólo hay que usar un poco de lógica y estilos css:
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
<style>
.cont{width:700px; height:180px; overflow:hidden; border:1px solid #000}
.el{ width:200px; line-height:25px; padding: 0 5px; background-color:#CCC; border:1px solid #000; margin:5px 0}
.sub{width:200px; padding:0 5px;float:left; margin:5px}
</style>
<script>
function hacer(){
	var vec=['A','B','C','D','E','F'];
	var c=document.createElement('div');
	c.className='cont';
	var f;
	for(var i=0, el;el=vec[i];i++){
		if(i%5==0){
			f=document.createElement('div');
			f.className='sub';
			c.appendChild(f);
			
		}
		var t=document.createElement('div');
		t.innerHTML=el;
		t.className='el';
		f.appendChild(t);
	}
	
	document.body.appendChild(c);
}
onload=hacer;
</script>
</head>

<body>
</body>
</html>

Última edición por Panino5001; 22/04/2009 a las 21:19