ValdouaD Posted June 8, 2006 Share Posted June 8, 2006 Here is my code taht I have for my results page. I would like to have it come out centered on the page instead of flush left.<? // Page two, search and display $connect = mysql_connect("localhost", "XXXXX", "XXXXX"); $db = mysql_select_db("schylling_storelist", $connect); $sql = "SELECT * FROM STOREDATA WHERE State = '".$_POST['state']."' OR ZIP_Code = '".$_POST['zipCode']."'"; $result = mysql_query($sql); $rows = mysql_num_rows($result); if($rows > 0) { echo "<table border=\"1\"> <th align=\"center\newstyle\">Name</th> <th align=\"center\">City</th> <th align=\"center\">State</th> <th align=\"center\">Sales Phone</th>"; while($row=mysql_fetch_array($result)) { echo "<tr> <td align=\"center\" class=\"newstyle\">".$row['Name']."</td> <td align=\"center\" class=\"newstyle\">".$row['City']."</td> <td align=\"center\" class=\"newstyle\">".$row['State']."</td> <td align=\"center\" class=\"newstyle\">".$row['Sales_Phone']."</td> </tr>"; } } else { echo "No results found"; } Also I have the input page code below, I would like to ahve this all lined up nice an center as well and I cant get it to look right:<? // Page 1, the form echo "<div style=\"margin-left: 15pt;\"><form name=\"search\" action=\"spage2.php\" method=\"post\"> Search by Zip: <input type=\"text\" name=\"zipCode\"> (example: 01922) <br> Search by State: <input type=\"text\" name=\"state\"> <input type=\"submit\"> (example: NY for New York) <br> </form></div>"; ?>Can anyone please help? Quote Link to comment https://forums.phpfreaks.com/topic/11498-need-help-centering-form/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.