Why there is a blank line when a row is set to style:display=none?

Hello,

I have a table with three rows, the rows need to be set to visible or invisible. The current problem is: when I set row 1 and 2 to invisible, there are still two blank rows above the third visible row, why how to remove it

Thanks.

Code is as below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<body>
<form name="Form1" method="post" id="Form1">

<table id="DataList1" cellspacing="0" border="0" style="width:100%;border-collapse:collapse;">
<tr>
<td>
<TABLE id="Table5" cellSpacing="1" cellPadding="1" width="70%" border="0">
<TR>
<TD width="20%" bgColor="#ccffff"><STRONG>&nbsp;&nbsp;Category</STRONG></TD>
<TD width="45%" bgColor="#ccffff"><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;Type</STRONG></TD>
<TD width="15%" bgColor="#ccffff"><STRONG>&nbsp;Platform</STRONG></TD>
<TD width="20%" bgColor="#ccffff"><STRONG>&nbsp;OIC</STRONG></TD>
</TR>
</TABLE>
</td>
</tr>
<tr>
<td>
<TABLE id="tbDataList" width="70%" style="VISIBILITY: hidden">
<TR>
<TD style="VISIBILITY: hidden">
<span id="DataList1__ctl1_lblCatID">1</span></TD>
<TD width="20%">
<span id="DataList1__ctl1_lblCat" style="width:100%;">Common Standard</span></TD>
<TD style="VISIBILITY: hidden">
<span id="DataList1__ctl1_lblTypeID">1</span></TD>
<TD width="45%">
<span id="DataList1__ctl1_lblType" style="width:100%;">Backup Retention and Control</span></TD>
<TD width="15%">
<span id="DataList1__ctl1_lblPlatform" style="width:100%;">WINNT</span></TD>
<TD width="20%">
<select name="DataList1:_ctl1:ddlOIC" id="DataList1__ctl1_ddlOIC" style="width:100%;">
<option value=""></option>
<option value="16">Cliff Barton</option>
<option value="18">Debbie Withers</option>
<option value="17">Kelvin Liu</option>
<option value="25">Mike Becker</option>
<option value="23">Mike Wilks</option>
<option value="1">Raymond Xie</option>

</select></TD>
</TR>
</TABLE>
</td>
</tr>
<tr>
<td>
<TABLE id="tbDataList" width="70%" style="VISIBILITY: hidden">
<TR>
<TD style="VISIBILITY: hidden">
<span id="DataList1__ctl1_lblCatID">1</span></TD>
<TD width="20%">
<span id="DataList1__ctl1_lblCat" style="width:100%;">Common Standard</span></TD>
<TD style="VISIBILITY: hidden">
<span id="DataList1__ctl1_lblTypeID">1</span></TD>
<TD width="45%">
<span id="DataList1__ctl1_lblType" style="width:100%;">Backup Retention and Control</span></TD>
<TD width="15%">
<span id="DataList1__ctl1_lblPlatform" style="width:100%;">WINNT</span></TD>
<TD width="20%">
<select name="DataList1:_ctl1:ddlOIC" id="DataList1__ctl1_ddlOIC" style="width:100%;">
<option value=""></option>
<option value="16">Cliff Barton</option>
<option value="18">Debbie Withers</option>
<option value="17">Kelvin Liu</option>
<option value="25">Mike Becker</option>
<option value="23">Mike Wilks</option>
<option value="1">Raymond Xie</option>

</select></TD>
</TR>
</TABLE>
</td>
</tr>
<tr>
<td>
<TABLE id="tbDataList" width="70%">
<TR>
<TD style="VISIBILITY: hidden">
<span id="DataList1__ctl1_lblCatID">1</span></TD>
<TD width="20%">
<span id="DataList1__ctl1_lblCat" style="width:100%;">Common Standard</span></TD>
<TD style="VISIBILITY: hidden">
<span id="DataList1__ctl1_lblTypeID">1</span></TD>
<TD width="45%">
<span id="DataList1__ctl1_lblType" style="width:100%;">Backup Retention and Control</span></TD>
<TD width="15%">
<span id="DataList1__ctl1_lblPlatform" style="width:100%;">WINNT</span></TD>
<TD width="20%">
<select name="DataList1:_ctl1:ddlOIC" id="DataList1__ctl1_ddlOIC" style="width:100%;">
<option value=""></option>
<option value="16">Cliff Barton</option>
<option value="18">Debbie Withers</option>
<option value="17">Kelvin Liu</option>
<option value="25">Mike Becker</option>
<option value="23">Mike Wilks</option>
<option value="1">Raymond Xie</option>

</select></TD>
</TR>
</TABLE>
</td>
</tr>
</table>
</form>
</body>
</HTML>



Answer this question

Why there is a blank line when a row is set to style:display=none?

  • cb3431

    How exactly are you going about setting the rows to visible or not visible on the fly I see that you're setting the style attribute, but I'm curious what code is setting that and when

  • Why there is a blank line when a row is set to style:display=none?