Search Tools Links Login

Controlling the Height of HTML Tables that Contain Forms


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.

Original Author: Tony Miro

Code

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!!!






About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 108 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.