didgydont Posted December 18, 2007 Share Posted December 18, 2007 hi all for some reason when i add a form to my table it makes the hight about 3 times bigger and uglyer. does anyone know how to make it skinny again ? before After <html> <?php $con = mysql_connect("localhost","my_user","my pass"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("my_db", $con); echo "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\"> <tr> <td width=\"40\"><b>Job #</b></td> <td><b>Client</b></td> <td><b> Item</b></td> <td><b> Cost</b></td> <td><b> Deposit</b></td> <td><b> Owing</b></td> <td><b> Ordered</b></td> <td><b> Status</b></td> </tr>"; $color1 = "#F0F8FF"; $color2 = "#CCFFFF"; $row_count = 0; $result = mysql_query("SELECT * FROM jobs ORDER BY jobnumber"); while($row = mysql_fetch_array($result)) { $customer = $row['clientid']; $cost = $row['cost']; $depos = $row['deposit']; $oweing = ($cost - $depos); $result2 = mysql_query("SELECT * FROM clients WHERE Uid='$customer'"); $row2 = mysql_fetch_array($result2); $status = $row['status']; $jobno = $row['jobnumber']; $custname = $row2['FirstName'] ." ". $row2['LastName']; $item = $row['item']; $orderd = $row['ordered']; $row_color = ($row_count % 2) ? $color1 : $color2; echo "<tr> <td width=\"40\" bgcolor=\"$row_color\" align=\"center\" nowrap> <form action=\"jobsearch.php\" method=\"post\" > <br/> <input type=\"hidden\" name=\"jobnumber\" value=\"$jobno\"> <input type=\"submit\" VALUE=\"$jobno\"> </form> </td> <td bgcolor=\"$row_color\">$custname</td> <td bgcolor=\"$row_color\">$item</td> <td bgcolor=\"$row_color\">\$$cost</td> <td bgcolor=\"$row_color\">\$$depos</td> <td bgcolor=\"$row_color\">\$$oweing</td> <td bgcolor=\"$row_color\">$orderd</td> <td bgcolor=\"$row_color\">$status</td> </tr>"; $row_count++; } echo "</table>"; mysql_close($con); ?> </html> Quote Link to comment Share on other sites More sharing options...
papaface Posted December 18, 2007 Share Posted December 18, 2007 This isn't a php problem but applying form { margin:0; padding:0; } or *{ margin:0; padding:0; } to your css should solve it. Quote Link to comment Share on other sites More sharing options...
didgydont Posted December 18, 2007 Author Share Posted December 18, 2007 i havent dont any css i think Quote Link to comment Share on other sites More sharing options...
papaface Posted December 18, 2007 Share Posted December 18, 2007 Well put some in.... Add <style type="text/css">*{ margin:0; padding:0; }</style> to the top of your page. I think thats the right syntax Quote Link to comment Share on other sites More sharing options...
didgydont Posted December 18, 2007 Author Share Posted December 18, 2007 thank you that worked i think i need to research css as im still total noob Quote Link to comment 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.