2013-07-18 14 views
0
Here is my IMG url:: postimg org/image/dwf13hme9/ 

<?php 
session_start(); 
if (!isset($_SESSION['username'])) { 
header('Location: LoginForm.php'); 
} 
?> 


    <html> 

    <title>Secured Page</title> 

    <head> 

    </head> 

    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 

    <body> 

    <FONT FACE="arial"> 

    <p align="left" style="margin-left:0px; margin-top: 0px;"> 

    <table cellspacing="0" cellpadding="5" border="1" width="560"> 
    <tr style="text-align:center"> 
    <td style="text-align:left ; width:175px">Record</td> 
    <td>Email</td> 
    <td>User_Name</td> 
    <td>User_Salt</td> 
    <td>Pass_Word</td> 
    <td>Edit</td> 
    </tr> 
    </p> 

<?php 

$db =new mysqli('xxxxxxxxx','xxxxxxxx','xxxxxxxx','xxxxxxxx'); 

if ($mysqli -> connect_error) { 
die('Connect Error: ' . $mysqli -> connect_error); 
} 
if ($result = mysqli_query($db, "SELECT * FROM members LIMIT 0,100")) { 
while ($row = mysqli_fetch_assoc($result)) { 
{ 
?> 

    <tr style="text-align:center"> 
    <td style="text-align:left"> 
    <? echo $row['id']; ?></td> 
    <td><? echo $row['email']; ?></td> 
    <td><? echo $row['usr']; ?></td> 
    <td><? echo $row['regIP']; ?></td> 
    <td><? echo $row['pass']; ?></td> 
    <td><a href="edit.php?id=<? echo $row['id']; ?>">Edit</a></td></tr>  

<?php 
}}} 
?> 

    <form action="Secured_Page_Search.php" method="post"> 
      Select_Table_To_Display:<br> <select name="Table"> 
    <option value="members">Members</option> 
    <option value="online">Online</option> 
    <input type="submit" name="submit_name" /> 
    </form> 

    <br><FONT FACE="impact">Logged In @: (<?php echo $_SESSION['username']; ?>)</FONT> 


    <style type="text/css"> 
      body{font-family:Impact;}         <-- 
      #container{width:0px;margin:auto;font-size:15pt;} 

      #menu{position:absolute;margin-top:10px;} 
      #menu ul .item{display:none;} 
      #menu ul:hover tem{display:block;background:#white;padding:1px;margin:1px;} 

      #menu ul:hover .item a{color:#abc;text-decoration:none;} 
      #menu ul:hover .item a:hover{color:grey;} 

#menu ul{width:110px;float:left;margin:0px;padding:2px;background:white;list- 

style:none;} 
      .clear{clear:both;height:10px;} 
    </style> 

    <div id="container"> 
    <h1></h1> 
    <div id="menu"> 

    <ul id="item1"> 
    <li class="top">Profile</li> 
    <li class="item"><a href="#">Profile User</a></li> 
    <li class="item"><a href="#">Profile I.M.</li> 
    <li class="item"><a href="#">Profile O.P.</a></li> 
    </ul> 

    <ul id="item1"> 
    <li class="top">Edit</li> 
    <li class="item"><a href="#">Edit User</a></li> 
    <li class="item"><a href="#">Edit I.M.</li> 
    <li class="item"><a href="#">Edit O.P.</a></li> 
    </ul> 
    </div> 
    <div class="clear"></div> 

    <FONT FACE="impact"> 

    <p align="left" style="margin-left:0px; margin-top: 110px;"> 

    <form action="Secured_Page_Search_Email.php" method="post"> 
      Search, Email:<br> <input type="text" name="email"><br> 
    <input type="submit" name="submit_name" /> 
    </form> 

    <form action="Secured_Page_Search_User.php" method="post"> 
      Search, User:<br>      <input type="text" name="usr"><br> 
    <input type="submit" name="submit_name" /> 

    </p> 

    </form>    
    </body> 
    </html> 

只是想獲得一些有用的代碼來正確居中MySQL表。任何幫助將不勝感激!! IMG URL鏈接@ TOP如何使MySQL表居中?

感謝

更新的代碼: 這裏是我的新的IMG網址:: postimg組織/圖像/ 5ln0yicmv/

更新的代碼: 這裏是我的新的IMG網址:: postimg org/image/5ln0yicmv/

今天早上我更新了代碼,這是結果,New PNG發佈了,我稍後會回來。由於

<?php 
session_start(); 
if (!isset($_SESSION['username'])) { 
header('Location: LoginForm.php'); 
} 
?> 


    <html> 

    <title>Secured Page</title> 

    <head> 

<style type="text/css"> 
table.gridtable { 
font-family: verdana,arial,sans-serif; 
margin: 0 auto; 
width: 560px; 
font-size:11px; 
color:#333333; 
border-width: 1px; 
border-color: #666666; 
border-collapse: collapse; 
} 
table.gridtable th { 
border-width: 1px; 
padding: 8px; 
border-style: solid; 
border-color: #666666; 
background-color: #dedede; 
} 
table.gridtable td { 
border-width: 1px; 
padding: 8px; 
border-style: solid; 
border-color: #666666; 
background-color: #ffffff; 
} 
table.gridtable th { 
border-width: 1px; 
padding: 8px; 
border-style: solid; 
border-color: #666666; 
background-color: #dedede; 
} 
table.gridtable td { 
border-width: 1px; 
padding: 8px; 
border-style: solid; 
border-color: #666666; 
background-color: #ffffff; 
} 
table.gridtable th { 
border-width: 1px; 
padding: 8px; 
border-style: solid; 
border-color: #666666; 
background-color: #ffffff; 
} 
</style> 

    </head> 

    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 

    <body> 

    <FONT FACE="arial"> 





<?php 
$db = new mysqli('xxxx', 'xxxx', 'xxxx', 'xxxxxx'); 

if ($mysqli -> connect_error) { 
die('Connect Error: ' . $mysqli -> connect_error); 
} 
if ($result = mysqli_query($db, "SELECT * FROM members LIMIT 0,100")) { 
while ($row = mysqli_fetch_assoc($result)) { 
{ 
?> 

<table class="gridtable"> 

<tr style="text-align:center"> 
<td style="text-align:left"> 
<th>Info</th><th>Info</th><th>Info</th><th>Info</th><th>Info</th><th>Info</th> 
</tr> 
    <tr style="text-align:center"> 
    <td style="text-align:left"> 
    <td><? echo $row['id']; ?></td> 
    <td><? echo $row['email']; ?></td> 
    <td><? echo $row['usr']; ?></td> 
    <td><? echo $row['regIP']; ?></td> 
    <td><? echo $row['pass']; ?></td> 
    <td><a href="edit.php?id=<? echo $row['id']; ?>">Edit</a></td></tr> 

</table> 

<?php 
}}} 
?>  



    <FONT FACE="impact"> 
    <form action="Secured_Page_Search.php" method="post"> 
      Select_Table_To_Display:<br> <select name="Table"> 
    <option value="members">Members</option> 
    <option value="online">Online</option> 
    <input type="submit" name="submit_name" /> 
    </form> 

    <br><FONT FACE="impact">Logged In @: (<?php echo $_SESSION['username']; ?>)</FONT> 


    <style type="text/css"> 
      body{font-family:Impact;}          
      #container{width:0px;margin:auto;font-size:15pt;} 

      #menu{position:absolute;margin-top:10px;} 
      #menu ul .item{display:none;} 
      #menu ul:hover.item{display:block;background:#white;padding:1px;margin:1px;} 

      #menu ul:hover .item a{color:#abc;text-decoration:none;} 
      #menu ul:hover .item a:hover{color:grey;} 

#menu ul{width:110px;float:left;margin:0px;padding:2px;background:white;list-tyle:none;} 
      .clear{clear:both;height:10px;} 
    </style> 

    <div id="container"> 
    <h1></h1> 
    <div id="menu"> 

    <ul id="item1"> 
    <li class="top">Profile</li> 
    <li class="item"><a href="#">Profile User</a></li> 
    <li class="item"><a href="#">Profile I.M.</li> 
    <li class="item"><a href="#">Profile O.P.</a></li> 
    </ul> 

    <ul id="item1"> 
    <li class="top">Edit</li> 
    <li class="item"><a href="#">Edit User</a></li> 
    <li class="item"><a href="#">Edit I.M.</li> 
    <li class="item"><a href="#">Edit O.P.</a></li> 
    </ul> 
    </div> 
    <div class="clear"></div> 

    <FONT FACE="impact"> 

    <p align="left" style="margin-left:0px; margin-top: 110px;"> 

    <form action="Secured_Page_Search_Email.php" method="post"> 
      Search, Email:<br> <input type="text" name="email"><br> 
    <input type="submit" name="submit_name" /> 
    </form> 

    <form action="Secured_Page_Search_User.php" method="post"> 
      Search, User:<br>      <input type="text" name="usr"><br> 
    <input type="submit" name="submit_name" /> 

    </p> 

    </form>    
    </body> 
    </html> 
+0

如果我能中心,我認爲這將是完美的頁面上的表... – Philcinbox

+0

,如果你繼續學習mysql/php/html/css,回到這裏幾個月/幾年,你會有一些笑聲;) –

+0

我很確定這是我的頭:B – Philcinbox

回答

2

如何這樣做:

table 
{ 
    margin: 0 auto; 
    width: 560px; 
} 

FIDDLE

+0

酷讓我給它一個鏡頭 – Philcinbox

+0

夥計這是驚人的真棒「FIDDLE」! THXX – Philcinbox

+0

@Philcinbox是這回答你的問題,然後請標記爲答案;) – Danield