By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,175 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,175 IT Pros & Developers. It's quick & easy.

border of table lost when div in cell hidden

P: n/a
Hello here is my html, if you click the missing image in the first
column on the left, the div is shown, when clicked again the div
disappears...but the bottom border disappears as well...Is there anyway
to stop this...???
<HTML>
<HEAD>
<title>Conform Inbox</title>
<meta content="False" name="vs_snapToGrid">
<META http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<script language="javascript" src="Inbox.js"
type="text/javascript"></script>
<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1)
{
theform = document.forms["Form2"];
}
else {
theform = document.Form2;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>
<script language="JavaScript">
function HierarGrid_toggleRow(sender)
{
if(sender == null)
return;

var state = 1;

//if the hidden row has not already been generated, clone the panel
into a new row
var existingRow = window.document.getElementById(sender.id +
"showRow");
if (existingRow==null)
{
//getting a reference to the table
var table = GetParentElementByTagName(sender, "TABLE");
var index = GetParentElementByTagName(sender, "TR").sectionRowIndex
+ 1;
//concatenate name of hidden panel => replace "Icon" from sender.id
with "Panel"\n
rowDivName = HierarGrid_ReplaceStr(sender.id, "Icon", "Panel");
var rowDiv = window.document.getElementById(rowDivName);
//adding new row to table
var newRow = table.insertRow(index);
newRow.id = sender.id + "showRow";
//adding new cell to row
var newTD=document.createElement("TD");
if(table.rows[0].cells[0].colSpan > 1)
newTD.colSpan = table.rows[0].cells[0].colSpan;
else
newTD.colSpan = table.rows[0].cells.length;
var myTD = newRow.appendChild(newTD);
//clone Panel into new cell
var copy = rowDiv.cloneNode(false);
copy.innerHTML = rowDiv.innerHTML;

copy.style.display = "";
myTD.innerHTML = copy.innerHTML;
rowDiv.parentNode.removeChild(rowDiv);

sender.src = HierarGrid_ReplaceStr(sender.src, "plus", "minus");
state = 1;
}
else
{
if (existingRow.style.display=="none")
{
existingRow.style.display = "";
sender.src = HierarGrid_ReplaceStr(sender.src, "plus", "minus");
state = 1;
}
else
{
existingRow.style.display = "none";
sender.src = HierarGrid_ReplaceStr(sender.src, "minus", "plus");
state = 0;
}
}
ChangeRowState(sender, state);
}
function HierarGrid_ReplaceStr(orgString, findString, replString)
{
pos = orgString.lastIndexOf(findString);
return orgString.substr(0, pos) + replString + orgString.substr(pos +
findString.length);
}
function GetParentElementByTagName(element, tagName)
{
var element=element;
while(element.tagName != tagName)
element = element.parentNode;
return element;
}
function ChangeRowState(sender, state)
{
var table = GetParentElementByTagName(sender, "TABLE");
var hiddenfield = table.getAttribute("ExpandedClientIDsName");
var rowStates = document.getElementsByName(hiddenfield)[0].value;

if(state == 1)
{
if(rowStates.indexOf(sender.id) == -1)
rowStates += ", " + sender.id;
}
else if(state == 0)
rowStates = rowStates.replace(sender.id, "");

document.getElementsByName(hiddenfield)[0].value = rowStates;
}
</script>
</HEAD>
<body bottomMargin="0" bgColor="#ffffff" leftMargin="0" topMargin="0"
rightMargin="0" marginwidth="0" marginheight="0">
<form name="Form2" method="post" action="default.aspx" id="Form2"
__smartNavEnabled="true">
<input type="hidden" name="HierarGrid_ExpandedIDs_HG1" value="" />
<div id="folders">
<table cellspacing="0" cellpadding="1" rules="all"
ExpandedClientIDsName="HierarGrid_ExpandedIDs_HG1" bordercolor="Black"
border="1" id="HG1"
style="background-color:White;border-color:Black;border-width:1px;border-style:None;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10px;width:100%;border-collapse:collapse;">
<tr style="color:White;background-color:#0B6CCE;">
<td>&nbsp;</td>
<td align="Center">Req.<br/>Attn.</td><td align="Center">Mail</td>
<td align="Center"><a
href="javascript:__doPostBack('HG1$_ctl1$_ctl0','' )"
style="color:White;">Name</a></td>
<td align="Center"><a
href="javascript:__doPostBack('HG1$_ctl1$_ctl1','' )"
style="color:White;">Issuer</a></td>
<td align="Center"><a
href="javascript:__doPostBack('HG1$_ctl1$_ctl2','' )"
style="color:White;">Date Issued <img
src="../images/tree/ElementArrowDown.jpg" border="0" /></a></td>
<td align="Center">Info</td>
</tr>
<tr
style="color:Black;background-color:#EEEEEE;border-color:#999999;">
<td>
<img id="HG1__ctl2_Icon"
onClick="javascript:HierarGrid_toggleRow(this);"
src="../../Conform/images/plus.gif" border="0" />
<div id="HG1__ctl2_Panel" class="HierarGrid_Item"
style="display:none">
<div id="HG1__ctl2_Panel_Table1">
<img src="../images/sp.gif" border="0" height="3" />
<table cellspacing="0" cellpadding="1" rules="all"
bordercolor="#999999" border="0"
id="HG1__ctl2_ChildTemplate_Table1_DG1"
style="background-color:White;border-color:#999999;border-width:0px;border-style:None;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:9px;width:100%;border-collapse:separate">
<tr style="color:White;background-color:#4791DA;">
<td
style="color:White;background-color:White;border-color:White;width:14px;">&nbsp;</td>
<td align="Center" style="width:50px;">Status</td>
<td align="Center" style="width:50px;">Doc<br/>Type</td>
<td>Name</td><td style="width:100px;">Revision No.</td>
<td align="Center" style="width:50px;">Doc<br/>Desc</td>
<td align="Center" style="width:50px;">Info</td>
</tr>
<tr style="color:Black;background-color:#EEEEEE;">
<td
style="color:White;background-color:White;border-color:White;width:14px;"></td><td
align="Center" style="width:50px;">
<img src="../images/xclam_sm.gif"/>
</td>
<td align="Center" style="width:50px;">
<img src="../images/check.gif"/>
</td>
<td>
<a id="HG1__ctl2_ChildTemplate_Table1_DG1__ctl2_ViewD oc"
href="javascript:__doPostBack('HG1$_ctl2$ChildTemp late_Table1$DG1$_ctl2$ViewDoc','')">bastard</a>
</td>
<td align="Center" style="width:100px;">1</td>
<td align="Center" style="width:50px;">
<img src="../images/history.gif" alt="Document Description :
asdfdsaffdsRevision Description : asdfdsaffds" />
</td>
<td align="Center" style="width:50px;">
<img src="../images/info.gif" alt="Document Creation Date :
07-12-2004 10:02:13 Revision Creation Date : 07-12-2004 10:02:13" />
</td>
</tr>
<tr style="color:Black;background-color:Gainsboro;">
<td
style="color:White;background-color:White;border-color:White;width:14px;"></td>
<td align="Center" style="width:50px;"><img
src="../images/xclam_sm.gif"/></td>
<td align="Center" style="width:50px;"><img
src="../images/test.gif"/></td>
<td><a id="HG1__ctl2_ChildTemplate_Table1_DG1__ctl3_ViewD oc"
disabled="disabled">capitalsRandom&All</a></td>
<td align="Center" style="width:100px;">1</td>
<td align="Center" style="width:50px;"><img
src="../images/history.gif" alt="Document Description : asdfsadRevision
Description : asdfsad" /></td>
<td align="Center" style="width:50px;"><img
src="../images/info.gif" alt="Document Creation Date : 07-12-2004
12:01:35Revision Creation Date : 07-12-2004 12:01:35" /></td>
</tr>
</table>
<img src="../images/sp.gif" border="0" height="3" />
</div>
</div>
</td>
<td align="Center">
<input name="HG1:_ctl2:distrec" id="HG1__ctl2_distrec" type="hidden"
value="15" /></input>
<asp:Label ID="flash1"><img
src="../images/exclamation_high.gif"/></asp:Label>
</td>
<td align="Center">
<a href='mailto:yu***@yahoo.co.uk'><img src="../images/mail.gif"
border="0" /></a>
</td>
<td align="Center">first1</td>
<td align="Center">ma***********@hiteclabs.co.uk</td>
<td align="Center">07-12-2004 15:34:31</td>
<td align="Center">
<img src="../images/info_blue2.gif" alt='Source : asdf On Behalf Of
: asdf Date Created : 07-12-2004 15:34:22' />
</td>
</tr>
</table>
</div>
<script language="JavaScript">
var HierarGrid_ExpandedIDs_HG1 =
(document.getElementsByName("HierarGrid_ExpandedID s_HG1")[0]).value.split(",
");
for(var index = 0; index < HierarGrid_ExpandedIDs_HG1.length; index++)
{
if(HierarGrid_ExpandedIDs_HG1[index] != null &&
HierarGrid_ExpandedIDs_HG1[index] != "")
HierarGrid_toggleRow(document.getElementsByName(Hi erarGrid_ExpandedIDs_HG1[index])[0]);
}
</script>
</form>
</body>
</HTML>

Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.