unwanted blank space in tables

  • Thread starter Thread starter Buz
  • Start date Start date
B

Buz

I am having a problem with extra, unwanted space showing
up on my web form tables. I've tried hand coding and can
get the htm file to display fine. But as soon as I bring
the form into Visual Studio, convert it to an aspx web
form, and insert my user controls, I start getting extra
blank space between my rows, even when I give an
explicit "height" attribute.

The problem seems to occur with tables that have rowspans
and/or user controls. It is extremely frustrating. I have
tried everything, but once Visual Studio gets ahold of
the form, the white space shows up.

Help would be greatly appreciated. Thank you.

Buz
 
Hi Buz,

Did you have HTML Table in the form and your Web User control is in the
Table's Cell? Based on my experience, there may be some unwant blank lines
in this situation, due to the size of Web User control. Once it is
displayed in a cell, other cell in same row have to fit same height, this
may cause some unwant blank lines.

Would you please post some actual code which can reprodcue the problem
exactly? With them, we may try to find if there is other way to display the
control and table in proper mode.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Well, you are right. I removed the three user controls in my 3 X 3 HTML
table and the problem resolved. I added back in my first user control, a
row-span of the first table column and there was still no problem. I
added in my second control (an Amazon.com link) which is a row span of
the bottom two cells of the right hand column and the problem partially
returned. I added back the third user control (a roll-over image link)
to the top right cell and the problem returned completely.

I expected the top row to expand to hold the user control, but the
expansion appears to be longer than the user control by a line or two.
Also, my left user contol does not "top" properely now.

Here is the HTML body:

<HTML>
<body>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td rowspan="3" width="148" valign="top">&nbsp;
<uc1:MLSideBar id="MLSideBar1" runat="server"></uc1:MLSideBar></td>
<td align="center" valign="middle"><img
src="Madame_librarian_banner.gif" width="544" height="128"></td>
<td width="130" valign="top" align="center">
<uc1:WordFairRollOver id="WordFairRollOver1"
runat="server"></uc1:WordFairRollOver>&nbsp;</td>
</tr>
<tr>
<td><div align="center"><font size="+2" face="Verdana, Arial,
Helvetica, sans-serif"><strong>Link Lists</strong></font></div></td>
<td rowspan="2" valign="top">&nbsp;
<uc1:AmazonList id="AmazonList1"
runat="server"></uc1:AmazonSearch></td>
</tr>
<tr>
<td valign="top"><p><font face="Verdana, Arial, Helvetica,
sans-serif">Wording goes here</td>
</tr>
</table>
</body>
</HTML>

Now the user control:

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if (a.indexOf("#")!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a;}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc)
x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<TABLE id="tblWordFairRO" cellSpacing="1" cellPadding="1" width="152"
border="0">
<TR>
<td width="39" valign=top align="center"&gt;<a href="http://wordfair"
onMouseOut="MM_swapImgRestore()"
onMouseOver="MM_swapImage('wordfair','','../images/fair_tentsmall2.gif',
1)"><img src="../images/fair_tentsmall.gif" alt="Word Fair"
name="wordfair" width="150" height="155"
border="0"></A></td>
</TR>
<TR>
<TD>
<P align=center><FONT face=Verdana>Writing
Services</FONT></P></TD>
</TR>
</TABLE>

Sure appreciate you looking at this. Thank you.
 
Hi Buz,

In the user control's table:

<TABLE id="tblWordFairRO" cellSpacing="1" cellPadding="1" width="152"
border="0">


You only specify the width not with height. If you set it to a proper
value, will the problem get better?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top