Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/10/2011, 15:44
zubintro
 
Fecha de Ingreso: septiembre-2007
Mensajes: 120
Antigüedad: 16 años, 7 meses
Puntos: 0
Respuesta: Pasar variable en tabla de forma horizontal

Para los que visitaron el tema y quedaron con la duda tengo las siguientes forma de solucionar este asunto.

1. Utilizando el codigo de alguien que escribio el script para tablas horizontales y modificando un poquito para adaptar aqui les va:

Código PHP:
Ver original
  1. <?php
  2. $filas = 10; // OK?
  3.  
  4. $pru= 0;
  5.  
  6. $prue= 10;
  7.  
  8.  
  9. echo '<table style="border: 1px inset" border="1">';
  10.  
  11. for ($x = 0; $x < $filas; ++$x)
  12. {
  13.      echo '<td>';
  14.    
  15.     if($pru <= $prue) {
  16.    
  17.     echo $pru++;
  18.    
  19.     }
  20.     echo '</td>';
  21. }
  22. echo '</table>';  
  23. ?>


2. Otra forma era usando el mismo script para cargar las tablas en esquema flotante, solo que asi se ajustan directamente al ancho del div o donde decidan montar las tablas

Código PHP:
Ver original
  1. <?php
  2.     $vn_recently_added_count = 0;
  3.     if(is_array($this->getVar("recently_added")) && sizeof($this->getVar("recently_added")) > 0){
  4.         foreach($this->getVar("recently_added") as $vn_object_id => $vs_thumb){
  5.  
  6.                     ?>
  7.             <table cellpadding="0" cellspacing="0" style="float: left">
  8.                          <tr><td valign="middle" align="center">
  9. <?php print caNavLink($this->request, $vs_thumb, '', 'Detail', 'Object', 'Show', array('object_id' => $vn_object_id)); ?>
  10.                          </td></tr></table>
  11. <?php
  12.             $vn_recently_added_count++;
  13.         }
  14.     }
  15. ?>


3. Usando una libreria de Jquery de flowplayer.org y haciendo unos ajustes en el php, el codigo quedaria asi y funciona perfectamente:

Código PHP:
Ver original
  1. <script src="http://cdn.jquerytools.org/1.2.6/full/jquery.tools.min.js"></script>
  2. <!-- standalone page styling (can be removed) -->
  3.     <link rel="stylesheet" type="text/css" href="http://static.flowplayer.org/tools/css/standalone.css"/>  
  4.  
  5. <style id='flashfirebugstyle' type='text/css'>object,embed{visibility:hidden !important;}</style><script type='text/javascript'>window.addEventListener('load', function() {document.addEventListener('DOMNodeInserted', function(e) {if(e.target.tagName.toLowerCase() == 'object' || e.target.tagName.toLowerCase() == 'embed'){try{FlashFirebug_init();}catch(e){}}}, false);try{FlashFirebug_init();}catch(e){}},false);</script></head>
  6.  
  7. <body>
  8.  
  9. <link rel="stylesheet" type="text/css" href="http://mexmedia.colmex.mx/tezcatl/themes/default/css/nuevoscroll/scrollable-horizontal.css" />
  10. <link rel="stylesheet" type="text/css" href="http://static.flowplayer.org/tools/css/scrollable-buttons.css" />
  11. <link rel="stylesheet" type="text/css" href="http://static.flowplayer.org/tools/css/scrollable-navigator.css" />    
  12.    
  13. <?php
  14.     $vn_scrollingColHeight = 600;
  15.     $vn_numItemsPerCol = 3;
  16. ?>
  17.  
  18. <!-- wrapper for navigator elements -->
  19. <div class="navi"></div>
  20. <!-- "previous page" action -->
  21. <a class="prev browse left"></a>
  22. <!-- root element for scrollable -->
  23. <div class="scrollable" id=browsable>  
  24.    
  25.    <!-- root element for the items -->
  26.    <div class="items">
  27.  
  28.    
  29.      <?php
  30.     $vn_recently_added_count = 0;
  31.    
  32.         if(is_array($this->getVar("recently_added")) && sizeof($this->getVar("recently_added")) > 0){
  33.  
  34.        
  35. $contador=1;
  36.  
  37.     foreach($this->getVar("recently_added") as $vn_object_id => $vs_thumb){
  38.  
  39.   if ($contador==1){ echo '<div>';}
  40.  
  41. print caNavLink($this->request, $vs_thumb, '', 'Detail', 'Object', 'Show', array('object_id' => $vn_object_id));
  42.  
  43. if($contador==5){
  44.     echo '</div>';
  45.    
  46.         $contador=1;
  47.        
  48. }
  49.  
  50. else     {
  51. $contador++;
  52. }
  53.  
  54. $vn_recently_added_count++;
  55.         }
  56.     }
  57. ?>
  58.            
  59.    </div>
  60.    
  61. </div>
  62.  
  63. <!-- "next page" action -->
  64. <a class="next browse right"></a>
  65.  
  66. <br clear="all">
  67.  
  68. <!-- javascript coding -->
  69.  
  70.  
  71. <script>
  72. // What is $(document).ready ? See: http://flowplayer.org/tools/documentation/basics.html#document_ready
  73. $(document).ready(function() {
  74.  
  75. // initialize scrollable together with the navigator plugin
  76. $("#browsable").scrollable().navigator();  
  77. });
  78. </script>
  79.  
  80.  
  81. Si alguien quiere que le explique como arme el codigo php con gusto..... espero le sirva a alguien.
  82.  
  83. Saludos