article

Controlling the Height of HTML Tables that Contain Forms

Email
Submitted on: 1/5/2015 6:42:00 AM
By: Tony Miro (from psc cd)  
Level: Beginner
User Rating: By 5 Users
Compatibility: ASP (Active Server Pages), VbScript (browser/client side)
Views: 390
 
     When working with HTML forms and ASP the order of the tags CAN and WILL make a difference! This article details some traps that HTML newbies can run into when designing ASP pages.

 
				

While trying to create a toolbar using HTML forms in an ASP page, I created the HTML form within a table using the following code:

<Table border="0" cellspacing="0" cellpadding="0" style="HEIGHT: 30px; WIDTH: 100%">
     <tr >
         <td bgcolor="navy" width="1%">
  
    </td>
         <td bgcolor="navy" width="99%" align="left" valign="center">
               <form method="POST" action="<%= strURL%>" id=form1 name=form1>
                     <input type="submit" value="<%= strEditBtnCaption %>" name="cmdEdit">
             </form>
          </td>
     </tr>
</Table>

 

    The code worked but I ended up with a blue background that was "taller" than I wanted it to be, as shown in the screen print below.

    I tried changing the <TABLE>, <TR>, and <TD> heights but nothing worked!!!

    Finally, I decided to move the <FORM> tags outside of the <TABLE> tags and this is what happened:


    <form method="POST" action="<%= strURL%>" id=form1 name=form1>
         <Table border="0" cellspacing="0" cellpadding="0" style="HEIGHT: 30px; WIDTH: 100%">
            <tr >
                <td bgcolor="navy" width="1%">
                </td>
                <td bgcolor="navy" width="99%" align="left" valign="center">
                     <input type="submit" value="<%= strEditBtnCaption %>" name="cmdEdit">
  
         </td>
          </tr>
      </Table>
   </form>

     It produced different/better results!!! Now I can control the height of  the blue background to look the way I want it to look!!!



Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.