Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/03/2007, 10:23
Avatar de Mikmoro
Mikmoro
Colaborador
 
Fecha de Ingreso: octubre-2006
Ubicación: K-pax
Mensajes: 7.228
Antigüedad: 17 años, 6 meses
Puntos: 280
Re: centrar tabla en pagina a dos columnas

Ese problema, como ya sabrás, se te produce porque la caja de la izquierda no tiene tamaño definido, pero con este código creo que lo podrás solucionar:

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" lang="es">
<head>
  <title>Tabla en caja</title>
  <style>
#cuerpo { border: 1px solid rgb(204, 204, 204);
margin: 30px auto 0pt;
padding: 20px 10px;
text-align: left;
font-size: 1.3em;
float: left;
width: 90%;
}
#columna { border-style: solid;
width: 200px;
float: right;
display: block;
position: relative;
}
#contenido { border-style: solid;
border-color: rgb(255, 102, 0);
position: relative;
margin-right: 220px;
display: block;
top: 0px;
}
  </style>
</head>
<body>
<div id="cuerpo">
<div id="columna">Columna derecha</div>
<div id="contenido">
<table style="margin: 0px auto;" align="center"
 border="1" cellpadding="2" cellspacing="2"
 width="80%">
  <tbody>
    <tr>
      <td> Celda 1</td>
      <td> Celda 2</td>
    </tr>
    <tr>
      <td> Celda3</td>
      <td> Celda 4</td>
    </tr>
  </tbody>
</table>
</div>
</div>
</body>
</html>
Ya contarás.

Mikel.