Form messing with table cell

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
markyboy17
Forum Newbie
Posts: 7
Joined: Mon Jan 16, 2012 3:38 am

Form messing with table cell

Post by markyboy17 »

Hi the code bellow is a table i created in php and i looks great in Chrome and Firefox but in Ie it looks awful.
The problem is where the form is created it is making a gap underneath the button inside the cell therefore stretching the whole row height so it matches. My question is what is wrong with the html that it works in Chrome and Firefox but not IE. BTW dont worry about the css i have removed it and it still looks good in Chrome But Not in IE so its not that

Code: Select all

                echo "<table border='1px' id='SearchTable' cellspacing='0px' cellpadding='0'>
<tr>
<th width='200px'>OrderID</th>
<th width='200px'>Purchase Order Number</th>
<th width='140px'>Date</th>
<th width='140'>Account Number</th>
<th width='140'>Supplier Name</th>
<th width='140'>TradingPartnerID</th>
</tr>";
                    try {
                    while ($oresultset = sqlsrv_fetch_array($oresults)) {
                        echo "<tr>";
                        echo "<form action='ExpandOrders.php' method='POST' id='blaa'>";
                        echo "<td>" . $oresultset['OrderID'] . "</td>";
                        echo "<td>" . $oresultset['DocumentNumber'] . "</td>";
                        echo "<td>" .date('d-M-Y',  strtotime($oresultset['DocumentDate'])) . "</td>";
                        echo "<td>" . $oresultset['AccountNumber'] . "</td>";
                        echo "<td>" . $oresultset['Supplier'] . "</td>";
                        echo "<td>" . $oresultset['TradingPartnerID'] . "</td>";
                        echo "<td>";
                        echo "<form action='ExpandOrders.php' method='POST' id='blaa' readonly='readonly'>";
                        echo "<input type='hidden' name='OrderExpandID' value='".$oresultset['OrderID']; echo "'>";
                        echo "<input type='submit' value='View Order' allign='Center'>";
                        echo "</form>";
                        echo "</td>";
                        echo "</form>";
                        echo "</tr>";
                    }
                    echo "</table>";
                    
                }
 catch (Exception $e){
     echo 'Message: ' .$e->getMessage();
 }
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Form messing with table cell

Post by Christopher »

You need to put the form outside the <table> or inside the <td></td>. Why do you have nested forms?
(#10850)
Post Reply