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> Link to comment https://forums.phpfreaks.com/topic/82170-solved-form-in-table/ 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. Link to comment https://forums.phpfreaks.com/topic/82170-solved-form-in-table/#findComment-417532 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 Link to comment https://forums.phpfreaks.com/topic/82170-solved-form-in-table/#findComment-417537 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 Link to comment https://forums.phpfreaks.com/topic/82170-solved-form-in-table/#findComment-417539 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 Link to comment https://forums.phpfreaks.com/topic/82170-solved-form-in-table/#findComment-417541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.