473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

seeking explanation for strange 'border-collapse' behavior

Hi,

I have example html below which contains a couple of hidden divs.
However, some of the table borders within these hidden divs are
actually displayed when they should not be.

In my example, I have comments indicating that if I remove the
'border-collapse' attribute for two of the tables within the hidden
divs, my problem is fixed.

However, in my real html page, I need the border-collapse attribute, or
the tables do not display as I would like them too.
Could anyone explain to me what I am doing wrong and how I can get the
divs to be truely hidden without compromising the table display when it
is necessary?

(My example does not make sense; it is just stripped down html to show
the unwanted affect)

Thanks very much for any insight into my problem!!
Irene
p.s. I had nice indents for the display below, but on the page preview
they were lost... sorry

<html>
<body onload="init();" >
<script language="javascript">
function init()
{ window.setTimeout( initTest, 1000 );
}
function initTest()
{document.getElementById( 'div1' ).innerHTML =
document.getElementById('div2').innerHTML;
}
</script>

<form name="searchForm">
<table style="border-collapse:collapse;">
<tr>
<td>
<div id="div3">
<table style="border-collapse: collapse; border-bottom: solid thin
Red; border-top: solid thin Red;">
<tr>
<td style="border-right: solid thin Blue;">xxxx</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<table style="border-collapse:collapse;">
<tr>
<td>
<div id="div1"></div>
</td>
</tr>
</table>
</form>
<div id="div2" style="visibility:hidden">
<table style="border-collapse:collapse;"><!-- if border-collapse is
removed here, div is truely hidden-->
<tr>
<td valign="middle" style="border-top: solid thin Green;"><b><span
id="spanID1">1234</span></b>
</td>
</tr>
</table>
</div>
<div id="div4" style="visibility:hidden">
<!-- if border-collapse is removed from table below, div is truely
hidden -->
<table style="border-collapse:collapse; border-bottom: solid thin Red;
border-top: solid thin Red;">
<tr>
<td style="border-right: solid thin Blue;">yyyy</td>
</tr>
</table>
</div>
</body>
</html>

Jul 23 '05 #1
2 4926
Hi again,

I forgot to mention that I am using IE 6.0.

Would anyone know why the border-collapse table attribute is causing
the hidden div to display some of the borders in the example below?

Thanks,
Irene

ir********@yahoo.com wrote:
Hi,

I have example html below which contains a couple of hidden divs.
However, some of the table borders within these hidden divs are
actually displayed when they should not be.

In my example, I have comments indicating that if I remove the
'border-collapse' attribute for two of the tables within the hidden
divs, my problem is fixed.

However, in my real html page, I need the border-collapse attribute, or the tables do not display as I would like them too.
Could anyone explain to me what I am doing wrong and how I can get the divs to be truely hidden without compromising the table display when it is necessary?

(My example does not make sense; it is just stripped down html to show the unwanted affect)

Thanks very much for any insight into my problem!!
Irene
p.s. I had nice indents for the display below, but on the page preview they were lost... sorry

<html>
<body onload="init();" >
<script language="javascript">
function init()
{ window.setTimeout( initTest, 1000 );
}
function initTest()
{document.getElementById( 'div1' ).innerHTML =
document.getElementById('div2').innerHTML;
}
</script>

<form name="searchForm">
<table style="border-collapse:collapse;">
<tr>
<td>
<div id="div3">
<table style="border-collapse: collapse; border-bottom: solid thin
Red; border-top: solid thin Red;">
<tr>
<td style="border-right: solid thin Blue;">xxxx</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<table style="border-collapse:collapse;">
<tr>
<td>
<div id="div1"></div>
</td>
</tr>
</table>
</form>
<div id="div2" style="visibility:hidden">
<table style="border-collapse:collapse;"><!-- if border-collapse is
removed here, div is truely hidden-->
<tr>
<td valign="middle" style="border-top: solid thin Green;"><b><span
id="spanID1">1234</span></b>
</td>
</tr>
</table>
</div>
<div id="div4" style="visibility:hidden">
<!-- if border-collapse is removed from table below, div is truely
hidden -->
<table style="border-collapse:collapse; border-bottom: solid thin Red; border-top: solid thin Red;">
<tr>
<td style="border-right: solid thin Blue;">yyyy</td>
</tr>
</table>
</div>
</body>
</html>


Jul 23 '05 #2
Hi,

For anyone who is interested, I just happened to stumble across the
solution (after dealing with this issue another way a while back):

the style attribute for the table tags that were <visibility:hidden>
should have been
<visibility:hidden; display:none;>

Then the 'border-collapse' table attribute works as expected.

Irene

ir********@yahoo.com wrote:
Hi again,

I forgot to mention that I am using IE 6.0.

Would anyone know why the border-collapse table attribute is causing
the hidden div to display some of the borders in the example below?

Thanks,
Irene

ir********@yahoo.com wrote:
Hi,

I have example html below which contains a couple of hidden divs.
However, some of the table borders within these hidden divs are
actually displayed when they should not be.

In my example, I have comments indicating that if I remove the
'border-collapse' attribute for two of the tables within the hidden
divs, my problem is fixed.

However, in my real html page, I need the border-collapse
attribute, or
the tables do not display as I would like them too.
Could anyone explain to me what I am doing wrong and how I can get the
divs to be truely hidden without compromising the table display

when it
is necessary?

(My example does not make sense; it is just stripped down html to

show
the unwanted affect)

Thanks very much for any insight into my problem!!
Irene
p.s. I had nice indents for the display below, but on the page

preview
they were lost... sorry

<html>
<body onload="init();" >
<script language="javascript">
function init()
{ window.setTimeout( initTest, 1000 );
}
function initTest()
{document.getElementById( 'div1' ).innerHTML =
document.getElementById('div2').innerHTML;
}
</script>

<form name="searchForm">
<table style="border-collapse:collapse;">
<tr>
<td>
<div id="div3">
<table style="border-collapse: collapse; border-bottom: solid thin
Red; border-top: solid thin Red;">
<tr>
<td style="border-right: solid thin Blue;">xxxx</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<table style="border-collapse:collapse;">
<tr>
<td>
<div id="div1"></div>
</td>
</tr>
</table>
</form>
<div id="div2" style="visibility:hidden">
<table style="border-collapse:collapse;"><!-- if border-collapse is
removed here, div is truely hidden-->
<tr>
<td valign="middle" style="border-top: solid thin Green;"><b><span
id="spanID1">1234</span></b>
</td>
</tr>
</table>
</div>
<div id="div4" style="visibility:hidden">
<!-- if border-collapse is removed from table below, div is truely
hidden -->
<table style="border-collapse:collapse; border-bottom: solid thin

Red;
border-top: solid thin Red;">
<tr>
<td style="border-right: solid thin Blue;">yyyy</td>
</tr>
</table>
</div>
</body>
</html>


Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: krunkelgarten | last post by:
Hi there, I've developed a site for a group of companies. And they wanted their adresses etc. on the site. The site is http://fmf.centrumweertpromotion.nl/ When you click on the 2nd thing from...
9
by: Robert Misiorowski | last post by:
Hello, I have a very perplexing (at least to me) problem that hopefully someone can help me with. I'm making a site with a 3 column layout. In the middle column (my fluid column) I am trying to...
0
by: h | last post by:
Hello everyone I am baffled by the behaviour of a webpage that I am trying to design(when viewed in ie6). I believe the problem arises when I use floats(at least that is the only occasion...
6
by: WindAndWaves | last post by:
Hi Gurus The page below has a strange error. It seems to be working very well, just when you enter 8 or 9 for day, month or year then you get an error. I really have no idea where that is...
7
by: M O J O | last post by:
Hi, I'm developing a asp.net application and ran into a strange css problem. I want all my links to have a dashed underline and when they are hovered, it must change to a solid line. Sounds...
20
by: Jim | last post by:
Hi, I am hoping that someone here can help me out. I am for the first time trying to implement a page design using only CSS instead of HTML tables. I've been able to get most of the page done...
14
by: Gerry Vandermaesen | last post by:
I'm having a problem with IE which displays my page footer partly beneath the viewable/scrollable window. It seems to calculate the bottom margin from the top of the div without looking at it's...
4
by: ben.dixon | last post by:
Hi, I'm using links for navigation on a test page, so each link will go to a question in the test e.g. Question 1, Question 2 etc. For each link i am using an Outer Border, Middle border and...
1
by: metaperl | last post by:
On reddit.com, many moons ago, I downloaded some code which generated a page using HTML tables from a picture of the page you wanted. However, I dont have any author information in the code and...
0
by: sjickells | last post by:
Hi I am having a problem using asp:TextBox's in a transparent table. I have a background image on the page and a table in the middle of the page. I have set the background colour of the table...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.