Jump to content

positioning tables


ohdang888

Recommended Posts

http://ohdang888.x10hosting.com/

 

thats the front page of a site i'm working on. I got the free template, and have been modifying it...

i want to move those "favorite games" right next to the right of the notifications...

 

heres my css for that part..

body {padding:0; margin:0; background:url(images/top.jpg) repeat-x}
body, td, input, textarea, select{
font:normal 10px Tahoma;
color:#2A383D;
line-height:14px;
vertical-align:top;
padding:0px;
margin:0px 0px 0px 0px;
}
span.noti{
font:normal 20px Tahoma;
}
.fave_games{
font:normal 20px Tahoma;
}

td.member_area{
font:normal 20px Tahoma;
vertical-align:middle;
border-left: thin solid;
height:170px;
width:300px;
}
.pic{
font:normal 23px Times;
float:left;
}
.menu {
vertical-align:middle;
height:48px;
position:absolute;
left:300px;
top:400px
}
.notif{
float:left;
margin-left: 5%;
}
.fave{
font:normal 9px Tahoma;
width:40px;
}
.fave_2{
font:normal 9px Tahoma;
float:left;
width:40px;
left:315px;
bottom:180px;
}

img    {border:0px;}
table  {width:100%;}

.member_logged{
float: center;
vertical-align: center;
padding:0px 0px 0px 0px;
width:750px;
}
.new_and_ad{
vertical-align: center;
float: right;
width:200px;
}

 

and the html that corresponts... there is php inthere, so i've marked where most of the "class=" are

			<td class="member_area">

					<?php
					$id = $_SESSION['id'];
					$id = mysql_real_escape_string($id);
					$username = $_SESSION['username'];
					if(strlen($id) > 0){

					mysql_select_db("members") or die(mysql_error());
					$result = mysql_query("SELECT `profile_picture` FROM `user_profiles` WHERE `id`='{$id}'") or die(mysql_error());
					$pic = mysql_fetch_array($result);
					echo '<table class="member_logged"><tr><td width="150" class="pic" >';//MEMBER LOGGED CLASS
					echo '<center>Hello '.$username.'<br>';
					if ($pic['profile_picture'] == 1) {
					?>
	<IMG SRC="/members/user_pic/<? echo $id ?>"  WIDTH="150" HEIGHT="110" BORDER="0">
<?php
  }else{
echo '<IMG SRC="none.jpg"  WIDTH="150" HEIGHT="110" BORDER="0">';
}  

echo '</td><td width="120px" class="notif"><center><span class="noti">Notifications:</span><br>';//SPAN CLASS

$result = mysql_query("SELECT `1`,`2` FROM `friend_requests` WHERE `id`='{$id}'") or die(mysql_error());

$new_friends = mysql_fetch_array($result);

$new_request1 = stripslashes($new_friends['1']);
$new_request2 = stripslashes($new_friends['2']);
if($new_request1 != 0){
if($new_request2 != 0){
	Echo '<a href="members/friend_request.php">New Friend Requests</a>';
}else{
Echo '<a href="members/friend_request.php">New Friend Request</a>';

}
}
if(empty($new_request1)){
$new_friends0 = 'none'
}

$result2 = mysql_query("SELECT `id` FROM `messages` WHERE `to`='{$id}' AND `read`='0'") or die(mysql_error());
$count = mysql_num_rows($result2);
if($count > 0){
echo '<br>You have '.$count.' <a href="inbox.php" >new messages!</a>';
}else{
$new_messages = 'none'; 
}


if (($new_friends0 == 'none' ) && ($new_messages == 'none')){
echo 'Nothing =(';
}
echo '<span class="noti"> <br>Online Friends: </span>';
echo '<br>username1<br>username2<br>username3<br>username4';
echo '</td></tr></table>';
echo '<table class="new_and_ad"><tr><td class="fave">';// FAVE ID

$result = mysql_query("SELECT * FROM `user_games` WHERE `id`='{$id}'") or die(mysql_error());
$game_data = mysql_fetch_array($result);

echo '<span class="fave_games"> Favorite Games: </span></td></tr><tr><td class="fave">';// fave
if(strlen(stripslashes($game_data['1'])) > 1){ 
echo '<a href ="game.php?title=';
   echo stripslashes($game_data['1']);
   echo '">';
   echo stripslashes($game_data['1']);
   echo '</a>'.'</br>';
//more game data
     
		   if(strlen(stripslashes($game_data['5'])) >= 1){ 
			echo '<a href ="game.php?title=';
			echo stripslashes($game_data['5']);
			echo '">';
			echo stripslashes($game_data['5']);
			echo '</a>'.'</br></td><td class="fave_2">';// THIS IS WHERE THE FAVE_2 IS

				if(strlen(stripslashes($game_data['6'])) >= 1){ 
				echo '<a href ="game.php?title=';
				echo stripslashes($game_data['6']);
				echo '">';
				echo stripslashes($game_data['6']);

							more game data...

								if(strlen(stripslashes($game_data['10'])) >= 1){ 
								echo '<a href ="game.php?title=';//start of link code
								echo stripslashes($game_data['10']);
								echo '">';
								echo stripslashes($game_data['10']);
								echo '</a>'.'</br>';// end of link code
								}
							}
						}
					}
				}
			}
		}
	}
}
}elseif(empty($game_data['game_1'])){
echo 'None =(</td></tr>';
}
echo '<tr><td>This is where a cool new ad will go!</td></tr></table>';
}	
?>
	</td>
			</tr>
			<tr>
				<td align="center" class="menu">//MENU CLASS
				<script src="menuscript.js" language="javascript" type="text/javascript"></script>
				<link rel="stylesheet" type="text/css" href="menustyle.css" media="screen, print" />
long code of menu stuff...
				<br>
				</td>
			</tr>

Link to comment
https://forums.phpfreaks.com/topic/95739-positioning-tables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.