html - How To Center MySQL Table? -


here 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 * 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> 

just trying useful code center mysql table. appreciated!! img url link @ top

thanks

updated code: here new img url:: postimg org/image/5ln0yicmv/

updated code: here new img url:: postimg org/image/5ln0yicmv/

this morning updated code , result,new png posted i'll later.

<?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 * 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> 

how doing this:

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

fiddle


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -