I created a menu bar on my page that contains many sub elements (tables). Each element is a container for related data. Within each element there may be an option to expand an area to display more data. All the elements in the menu are constrained within one div with a set width. The code below is the code for one sub element within the div. I included the div tag and the JavaScript needed for the page.
The problem is that when I click on the link to expand the area for more detail, my table gets a few pixes wider. Because this is in a vertical menu I cannot have any width changes.
Another problem is now that it has gotten wider, the parent div expands, making the other items in the div expand as well.
I have gone and locked down all widths to ensure width contraint. the height can change all it wants. The items within the table are not too big. There is plenty of extra room within the table. But when I click on the link, wham! It gets wider!
What do I have to do to constrain the width?
I am coding for IE 5.5 up only.
Not wanting to post a lot of HTML, I have included only a snippet.
===================================
<div style="width:210">
<table cellpadding="0" cellspacing="0" width="100%" style="margin-top:10;">
<tr>
<td class="bg1" style="border:1 solid #999999; border-top:none">
<table width="195" border="1" cellpadding="0" cellspacing="0" style="margin-top:5; margin-bottom:10;" align="left">
<tr>
<td class="t1">
<a href="javascript:doCollapse('moreComments','commentNode')"><img src="/images/tree_icon_plus.gif" id="commentNode" border="0" class="linkNoChange"> Comments</a>
</td>
</tr>
<tr>
<td class="t1" id="moreComments" style="display:none">
Here are some more comments
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script language="javascript">
// Collapses the requested area
function doCollapse(elemId, imageId) {
targetElement = document.getElementById(elemId);
targetNodeImg = document.getElementById(imageId);
if (targetElement.style.display == "none"
{
targetElement.style.display = "";
targetNodeImg.src = "/images/tree_icon_minus.gif";
}
else {
targetElement.style.display = "none";
targetNodeImg.src = "/images/tree_icon_plus.gif";
}
}
</script>
The problem is that when I click on the link to expand the area for more detail, my table gets a few pixes wider. Because this is in a vertical menu I cannot have any width changes.
Another problem is now that it has gotten wider, the parent div expands, making the other items in the div expand as well.
I have gone and locked down all widths to ensure width contraint. the height can change all it wants. The items within the table are not too big. There is plenty of extra room within the table. But when I click on the link, wham! It gets wider!
What do I have to do to constrain the width?
I am coding for IE 5.5 up only.
Not wanting to post a lot of HTML, I have included only a snippet.
===================================
<div style="width:210">
<table cellpadding="0" cellspacing="0" width="100%" style="margin-top:10;">
<tr>
<td class="bg1" style="border:1 solid #999999; border-top:none">
<table width="195" border="1" cellpadding="0" cellspacing="0" style="margin-top:5; margin-bottom:10;" align="left">
<tr>
<td class="t1">
<a href="javascript:doCollapse('moreComments','commentNode')"><img src="/images/tree_icon_plus.gif" id="commentNode" border="0" class="linkNoChange"> Comments</a>
</td>
</tr>
<tr>
<td class="t1" id="moreComments" style="display:none">
Here are some more comments
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script language="javascript">
// Collapses the requested area
function doCollapse(elemId, imageId) {
targetElement = document.getElementById(elemId);
targetNodeImg = document.getElementById(imageId);
if (targetElement.style.display == "none"
targetElement.style.display = "";
targetNodeImg.src = "/images/tree_icon_minus.gif";
}
else {
targetElement.style.display = "none";
targetNodeImg.src = "/images/tree_icon_plus.gif";
}
}
</script>