Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/10/2011, 05:46
catapelaez84
 
Fecha de Ingreso: octubre-2011
Mensajes: 13
Antigüedad: 12 años, 6 meses
Puntos: 0
Style de una tabla

hola, estoy tratando de darle estilo a una tabla quiero que tenga cierto tipo de letra u lo mas importante que este posicionada a la derecha de la pagina y a una altura especifica.
He intentado poner dentro del Tag <table> la posicion top:240px; left:1000px;.
Tanbien intente poner esta informacion en la hoja de estilo, y como ultima opcion intente meter la tabla dentro de un div.
Sin embargo nada de esto hace que la tabla cambie de sitio del punto 0,0. Le puse en el tag Table float right y lo que hizo fue ponermelo en la esquina superior derecha..
La verdad ya no se que estoy haciendo mal.

Pongo los codigos por si alguien pilla mi error.
Agradezco cualquier ayuda.. es URGENTE!!!

Código HTML:
Ver original
  1. <div id="tienetabla" style="top:40%; left:60%; background-color:#9C3;">
  2. <table class="registro" style="float:right; top:inherit;">
  3.     Historial de las ultimas 5 posiciones recibidas
  4.   </caption>
  5. <tr>
  6. <th>Num </th>
  7. <th> Fecha</th>
  8. <th> Hora</th>
  9. <th>Longitud</th>
  10. <th>Latitud</th>
  11. </tr>
  12.  
  13.  
  14. <?php
  15.     $archivo = file("historial.txt");
  16.       if (!$archivo)
  17.       {
  18.       echo "<p>No se pudo abrir el archivo.</p>";
  19.       }
  20.         $filas=count($archivo);
  21.            
  22.         for($i=0;$i<$filas;$i++)
  23.           {
  24.           $campo=explode(",",$archivo[$i]);
  25.           $date = $campo[0];
  26.           $time = $campo[1];
  27.           $lnt = $campo[2];
  28.           $lngNO = $campo[3];
  29.           $sustituye = array("\r\n", "\n\r", "\n", "\r");
  30.         $lng = str_replace($sustituye, "", $lngNO);
  31.    
  32.             if(($filas-$i)<=5){
  33.            
  34.                
  35. ?>
  36. <tr>
  37.     <td><?php echo $i;?></td>
  38.     <td><?php echo $date;?></td>
  39.     <td><?php echo $time;?></td>
  40.     <td><?php echo $lnt;?></td>
  41.     <td><?php echo $lng;?></td>
  42.   </tr>
  43. <?php
  44. }}
  45. ?>
  46. </table></div>


la hoja de estilo
Código CSS:
Ver original
  1. #tienetabla{
  2. position: absolute;
  3. top:240px;
  4. left:1115px;
  5. }
  6. table.registro{
  7.     position:absolute;
  8.     top:10px;
  9.     left:10px;
  10.    
  11.     }
  12. table.registro caption{
  13.     font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  14.     font-size: medium;
  15.     font-style: italic;
  16.     font-weight: bolder;
  17.     font-variant: normal;
  18.     color: #006;
  19.     text-align: center;
  20. }
  21. table.registro th{
  22. position:relative;
  23. float:right;
  24. font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  25. font-size: small;
  26. font-weight: bolder;
  27. font-style: italic;
  28. color: #006;
  29.    
  30. }
  31. table.registro td{
  32. position:relative;
  33. float:right;
  34. font-family: "Lucida Sans Unicode", "Lucida Grande", sans-serif;
  35. font-size: small;
  36. font-style: italic;
  37. color: #006;
  38.    
  39. }