De acuerdo, gracias por interesarte, te dejo el código completo:
el código de la tabla
Código PHP:
<?php
session_start();
include('config.php');
?>
<!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>
<title>Mis amigos</title>
<link rel="stylesheet" href="perfilcss.css" />
</head>
<?php
if(isset($_SESSION['correo'])){
$correouser=$_SESSION['correo'];
$conexion=conectar();
$comprobacion1 = mysql_query("SELECT * FROM registrados WHERE correo='$correouser'",$conexion) or die ("Query Fallo".mysql_error());
$row = mysql_fetch_array($comprobacion1);
$nombresesion = $row["nombre"];
$apellidossesion = $row["apellidos"];
$idsesion = $row["id"];
?>
<body>
<div id="menu" class="menu" >
<input type="button" class="bmenu" onclick="location.href='miperfil.php'" value="Vipefy" />
<input type="button" class="bmenu" onclick="location.href='amigos.php'" value=" Mis amigos" />
<input type="button" class="bmenu" onclick="location.href='destruir.php'" value="Desconexión" />
<input type="button" class="bmenu" onclick="location.href='mensajes.php'" value="Mensajes" />
<input type="button" class="bnombre" value="<?php echo $nombresesion." ".$apellidossesion ?>" />
<input type="button" class="bmenuamis" onclick="location.href='newfriends.php'" value="Encontrar amistades" />
</div>
<?php
$amigoscole=mysql_query("SELECT * FROM amigos WHERE ((de = '$idsesion') OR (para = '$idsesion')) AND estado='2' ",$conexion);
while ( $selecc= mysql_fetch_array($amigoscole)){
$de=$selecc["de"];
$para=$selecc["para"];
if($de==$idsesion){
?>
<div class="divamigos1" name="divamigos1" id="divamigos1">
<?php
$buscapara=mysql_query("SELECT * FROM registrados WHERE id='$para'",$conexion);
$fetchpara=mysql_fetch_array($buscapara);
$nombrepara=$fetchpara["nombre"];
$apellidospara=$fetchpara["apellidos"];
$idpara=$fetchpara["id"];
?>
<table name="amigos1" class="amigos1" id="amigos1">
<tr>
<td>
<?php echo $nombrepara;?> <?php echo $apellidospara; ?> <a href="perfil.php?id=<?php echo $idpara;?>">IR</a>
</td>
</tr>
</table>
</div>
<?php
}
if($para==".$idsesion."){
?>
<table name="amigos2" class="amigos2" value="Amigos">
<tr>
<td><a href="perfil.php?id=<?php echo $selecc['de']?>">IR</a></td>
</tr>
</table>
<?php
}
}
}else {
?>
Esta sección es para usuarios,
<a href="index.html">click aquí para iniciar sesión</a>
</body>
<?php
}
?>
</html>
Y este es el CSS (es un poco largo, pero lo referente a la tabla está hacia el final)
Código PHP:
.body {
background-color: #EBEBEB;
}
.logout {
background-color: black;
border-color: white;
border-width: 2px;
color: #FFC90E;
font-family: calibri;
font-size: 14px;
}
.menu {
background-color: #22B14C;
border: 2px solid #22B14C;
height: 30px;
left: 0;
position: fixed;
top: 0;
width: 1600px;
}
.bmenu {
background-color: #22B14C;
border: 2px solid #22B14C;
color: white;
font-family: arial;
font-size: 14px;
font-weight: bold;
height: 30px;
width: 120px;
}
.bnombre {
background-color: #22B14C;
border: 2px solid #22B14C;
color: white;
font-family: arial;
font-size: 14px;
font-weight: bold;
height: 30px;
position: fixed;
right: 15px;
top: 0;
width: 240px;
}
.envio {
background-color: white;
border: 4px solid #22B14C;
height: 345px;
margin-left: 54%;
margin-top: 10%;
width: 497px;
}
.campos {
margin-left: 23px;
margin-top: 11px;
}
.nombre {
background-color: #22B14C;
border: 2px solid #22B14C;
clear: both;
color: white;
font-family: arial;
font-size: 14px;
font-weight: bold;
height: 26px;
margin-left: 277px;
text-align: center;
width: 220px;
}
.menuvertical {
background-color: #22B14C;
height: 680px;
margin-left: -8px;
margin-top: -3%;
width: 147px;
}
.inpcurso {
background-color: #EBEBEB;
border: 2px solid black;
color: black;
font-size: 14px;
font-weight: bold;
height: 32px;
margin-top: 11%;
text-align: center;
width: 142px;
}
.curso {
color: white;
font-size: 14px;
font-weight: bold;
margin-left: 1%;
margin-top: 6%;
text-align: left;
}
.escuela {
color: white;
font-size: 14px;
font-weight: bold;
margin-left: 1%;
margin-top: 12%;
text-align: left;
}
.bmenuamis {
background-color: #22B14C;
border: 2px solid #22B14C;
color: white;
font-family: arial;
font-size: 14px;
font-weight: bold;
height: 30px;
width: 160px;
}
.buscaramigos {
background-color: white;
border: 1px solid #22B14C;
margin-left: 22%;
margin-top: 10%;
padding: 15px;
}
.nombreperf {
background-color: white;
border: 1px solid #22B14C;
}
.divnombre {
height: 40px;
margin-left: 40%;
margin-top: 2%;
text-align: center;
width: 200px;
}
.letrasol {
margin-left: 50%;
margin-top: 10%;
text-align: center;
}
.enviada {
background-color: white;
border: 3px solid red;
margin-left: 54%;
margin-top: -2%;
text-align: center;
width: 179px;
}
.divsoli {
height: 25px;
width: 426px;
margin-left:50%;
margin-top:10%;
}
.botonsoli {
background-color: white;
border: 1px solid red;
}
.divenviada {
margin-left: 41%;
margin-top: 2%;
}
.botonenv {
background-color: white;
border: 1px solid red;
width: 178px;
}
.divagregar {
height: 40px;
margin-left: 54%;
margin-top: -2%;
width: 178px;
}
.agregar {
background-color: white;
border: 1px solid red;
height: 34px;
width: 172px;
}
.botonamistad {
background-color: white;
border: 1px solid red;
}
.divamistad {
height: 23px;
margin-left: 54%;
margin-top: -2%;
width: 150px;
}
.selectcolegio{
background-color: #EBEBEB;
height: 32px;
text-align: center;
width: 142px;
}
.cartelamigos{
height: 40px;
margin-left: 23%;
margin-top: -12%;
text-align: center;
width: 184px;
}
.divsoli{
margin-left: 385%;
margin-top: -45%;
text-align: center;
width: 386px;
}
.fotoenperfil {
border: 1px solid black;
height: 331px;
margin-left: 38%;
text-align: center;
width: 331px;
}
.fotoperfil {
border: 1px solid black;
height: 331px;
margin-left: 38%;
margin-top: 10%;
text-align: center;
width: 331px;
}
.novedades {
background-color: white;
border: 1px solid #22B14C;
margin-left: 2%;
margin-top: 2%;
padding: 4px;
width: 370px;
}
.fecha {
display: inline;
margin-left: 71%;
}
.titulo{
text-align:center;
color:green;
font-weight:bold;
}
.titulonovedades {
color:green;
font-weight:bold;
font-size:20px;
margin-left:2%;
margin-top:5%;
}
.amigos1{
border: 1px solid #22B14C;
margin-top:25px;
}
.divamigos1{
}