Forum Moderators: not2easy
About your problem though - could you strip your code down bare (only so it still shows the problem) and then post it? Both (X)HTML and CSS?
CSS
html,
body {
padding: 0px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
}
.row1specs {
height: 14%;
}
.sectionhead {
text-align: left;
border-style: solid;
border-style: ridge;
background: #ebebeb;
border-right-width: .05em;
border-left-width: .05em;
border-bottom-width:0em;
border-top-width: .05em;
border-color: gray;
height: 100%;
width: 100%;
float: left;
overflow:auto;
}
Html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
document.write("<link REL='StyleSheet' TYPE='text/css' HREF='m.css'/>")
</script>
</head>
<body>
<table border cols=1 height="100%" width="100%">
<tr class="row1specs">
<td width="20%">
<div class="sectionhead" id="abcd">
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
abcdefghi<br>
</div>
</td>
</tr>
<tr><td>
</td>
</tr>
<tr><td>
</td>
</tr>
<tr><td>
</td>
</tr>
<tr><td>
</td>
</tr>
<tr><td>
</td>
</tr>
<tr><td>
</td>
</tr>
</table>
</body>
</html>
You can replace your current doctype with this one:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> ... the problem with this is, it means IE will now display as the standards-compliant ones do, not the other way around.
It's a start, however, if you can start trying to make it look right in a standards-compliant browser (Firefox, Safari, Opera, though I still believe Firefox the best for this) and then see how it goes in IE.
hmmm.. well I can get it to work in IE and Firefox, but Opera is being very weird, disappearing content and background color.. I'll show you what I have so you can try some stuff -
I did have another solution which works for them all though it would only work for a single column table I gotta go for a bit so maybe you and others will play around with this and I'll come back to see what I was missing!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Untitled</title>
<style type="text/css" media="screen">
html, body {
padding: 0; margin: 0; height: 100%;
}
table {border: 0; width: 100%;}
table, tbody {height: 100%;} /* moz needs tbody */tr {height: 10%;}
tr.r7 {height: 39%;} /* 1% less than necessary else there's a scrollbar in IE and FF must be rounding diff */td {padding: 0; border: 0;}
/* all like the following two, even with row height but content disappears on Opera */
td {height: 10%;}
.r7 td {height: 39%;}/* td {height: inherit;} /* IE and FF like this one */
/* td {height: 100%;} /* No one likes this one content disappears in opera too */.scroll {
/* position: relative; z-index: 50; */
background: #dad;
height: 100%;
overflow: auto;/* removing this brings content back in Opera ... is where I'm stuck */
padding: 0; margin: 0;*float: left;/* IE needs this it's here as *hack temporarily */
*width: 100%; /* ditto - and this */
}tr.o {background: #eee;}
tr.e {background: #ffe;}
</style><!--[if IE]>
<style type="text/css" media="screen"></style>
<![endif]-->
</head>
<body>
<table summary="#" cellpadding="0" cellspacing="0">
<tr class="row1 o">
<td>
<div class="scroll">
abcdefghi<br>abcdefghi<br>abcdefghi<br>abcdefghi<br>abcdefghi<br>
abcdefghi<br>abcdefghi<br>abcdefghi<br>abcdefghi<br>abcdefghi<br>
</div>
</td>
</tr>
<tr class="r2 e"><td> row 2</td></tr>
<tr class="r3 o"><td> row 3</td></tr>
<tr class="r4 e"><td> row 4</td></tr>
<tr class="r5 o"><td> row 5</td></tr>
<tr class="r6 e">
<td>
<div class="scroll">
abcdefghi<br>abcdefghi<br>abcdefghi<br>abcdefghi<br>abcdefghi<br>
abcdefghi<br>abcdefghi<br>abcdefghi<br>abcdefghi<br>abcdefghi<br>
</div>
</td>
</tr>
<tr class="r7 o"><td> row 7</td></tr>
</table>
</body>
</html>
I just exaggerated the heights to make it easier to see of they were being respected.. tbody is the key for FF.. just Opera now - any any others like to report Mac test.. ;)
Suzy
[edited by: SuzyUK at 5:36 pm (utc) on Mar. 12, 2007]
As far as I can tell it's a combination of a % based height - overflow: auto - and a table - as soon as you have those three ingredients Opera thinks that overflow:auto = overflow:hidden (and height:0). Well almost it's actually OK until the content overflows!
You can test this by adding a thick top/bottom border to the overflowing div, it will throw 100% height out of the window but..
overflow: visible does what it says, content will overflow the div which does take on the correct height as inherited from the table
overflow: scroll also does what it says - content is confined to the required height but both horizontal and vertical scrollbar appears (this appears to be closest to the desired effect)
but as soon as you as you add overflow: auto; - and the content does actually overflow - the whole lot gets cropped - if you've added the borders you can see that the whole div is collapsed you should now see a double width border and nothing else!
ackkk...
sorry chuckz I *think* I know what you want.. but it seems it's not going to happen unless you want to chuck opera Support out the window?
provided that the div height is expressed in "em"
Yep., agreed... it's only percentage it seems to be happening with.. if you can give an explicit width then you should be fine
As a novice, this suggests to me that the difficulty that the browser is having is in understanding what the % relates to - percentage of what.
[edited by: SuzyUK at 9:55 pm (utc) on Mar. 12, 2007]