Foro de elhacker.net

Programación => Desarrollo Web => Mensaje iniciado por: skip77 en 20 Noviembre 2011, 01:52 am



Título: Como paginar contenido de tabla ?
Publicado por: skip77 en 20 Noviembre 2011, 01:52 am
Hola, tengo el siguiente problema, busque y busque codigos pero no puedo hacer lo que quiero  :(.

Con el codigo siguiente:


Código:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>

<body bgcolor="#000000">


<table cellpadding="0" cellspacing="0">
<!-- MSTableType="layout" -->
<tr>

<td height="160" width="120" valign="top">
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>


<td height="160" width="120" valign="top">
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>


<td height="160" width="120" valign="top">
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>


<td height="160" width="120" valign="top">
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>


<td height="160" width="120" valign="top">
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>


<td height="160" width="120" valign="top">
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>


<td height="160" width="120" valign="top">
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>


<td height="160" width="120" valign="top">
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>



</tr>
</table>


</body>




Mi idea es que a partir de este fragmento del codigo anterior :



Código:
	<td height="160" width="120" valign="top">	
<a target="_blank" href="HIPERVINCULO" title="TITULO" >
<img border="0"Español src="IMAGEN" width="120" height="160"></a></td>
<td height="110" width="10" valign="top"><img border="0" src="IMAGEN_TRANSPARENTE_PARA_SEPARAR" width="10" height="110"></td>



me lo tome como 1 elemento de la paginacion.  O sea que tendria 8 elementos para paginar.

Me gustaria que por ejemplo la paginacion sea 2 elementos por pagina.
O sea que tendria 4 paginas en total completas.

Tambien armar el codigo pensando que agregare mas fragmentos como ese.

PD: Probe codigos y trate de adaptarlos para que me funcione para lo que quiero, pero no lo logro. Lo maximo que llegue con uno fue llegar a tener todo bien, salvo que me cargaba todas las imagenes en la primera pagina y yo quiero que carguen  a medida que se hace la paginacion.

Espero que me puedan ayudar   ;-) o me pudan dar indicios de como puedo seguir  ;-).

Saludos!


Título: Re: Como paginar contenido de tabla ?
Publicado por: Mr. Crowley en 23 Noviembre 2011, 03:02 am
Aquí esta un plugin para JQuery, se pueden paginar las tablas y ordenar ASC/DESC las columnas.
http://tablesorter.com/docs/example-pager.html

Con todo respeto, que código HTML tan horrible!