2013-07-18 5 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 LINK @ TOPКак настроить таблицу MySQL?

Благодаря

Обновленный код: Вот мой НОВЫЙ IMG URL :: postimg орг/изображение/5ln0yicmv/

Обновленный код: Вот мой НОВЫЙ IMG URL :: postimg org/image/5ln0yicmv/

Сегодня утром я обновил код, и в результате появился новый 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

Чувак Это освободившийся Awesome «FIDDLE» !!!! THXX – Philcinbox

+0

@Philcinbox это ответил на ваш вопрос, затем, пожалуйста, отметьте как ответ;) – Danield

Смежные вопросы