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 链接@顶部

谢谢

更新代码:这是我的新 IMG 网址:: postimg org/image/5ln0yicmv/

更新代码:这是我的新 IMG 网址:: 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>
4

1 回答 1

2

这样做怎么样:

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

小提琴

于 2013-07-18T05:46:48.923 回答