Jump to content

[SOLVED] form in table


didgydont

Recommended Posts

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

b4.jpg

After

after.jpg

 

  <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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.