Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excessive space

Status
Not open for further replies.

sodakotahusker

Programmer
Mar 15, 2001
601
I have a couple of pages suffering from the same problem. I have a couple of asp.net server side multiline text which create textarea elements in html. Directly below the 2nd textarea I start a table. Why would there be a gap of about 4 lines of text between my textarea and the first row of the table? I tried the to make the height of the textbox smaller but that just shrunk the box itself.
 
Most likely if textarea is in the form and table is not, unwanted space comes from the form. Try something like:
Code:
<style type="text/css">
form {
  margin-bottom: 0;
}
</style>
 
The problem is with the <table>. The structure should be:
Code:
<table>
   <tr>
      <td>contents of cell</td>
      <td>contents of cell</td>
   </tr>
   <tr>
      <td>contents of cell</td>
      <td>contents of cell</td>
   </tr>
</table>

In other words, all the content of your table should be contained within <td> tags, which in turn have to be contained within <tr> tags. Anything that breaks that gets rendered outside the table (in IE at least). What you have is:
Code:
<table>
   <tr>
      <td>contents of cell</td>
      [red]&nbsp;&nbsp;&nbsp;...[/red]
      <td>contents of cell</td>
   </tr>
   <tr>
      <td>contents of cell</td>
      <td>contents of cell</td>
   </tr>
</table>

The code in red is not within a <td> tag so it gets rendered outside the table. Go through it by hand and remove code like that. Also, you should close off all <td> tags with </td>. Most of them are ok, but not all.
 
In addition to blueark's comment, I suggest you run your page through the validator at w3.org. Without a doctype and valid html, your page is not guaranteed to look how you expect it to on any browser. And btw, as it looks like you're using Frontpage, be aware that it is known for generating bad, bloated html. You may want to consider another editor or even coding by hand in a text editor.

 
Actually I am using VIsual Studio dot Net 2003- so the actual html is being rendered by APS.NET.

I bet I pasted those spaces into the code trying to line up my input elements - and I missed the td tags.

Thanks for everyone's help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top