Mark__G
10-16-2007, 08:34 AM
I can't figure out why the scrollbar wont show up in IE but works fine in Mozilla?
html ---->
<div class="tableContainer" id="tableContainer">
<table border="0" cellpadding="0" cellspacing="0" width="755" class="scrollTable">
<tbody class="scrollContent">
<tr>
<td>
<br/>
SCROLLABLE PAGE CONTENT
</td>
</tr>
</tbody>
</table>
</div>
css ---->
/* define height and width of scrollable area. Add 16px to width for scrollbar */
/* allow WinIE to scale 100% width of browser by not defining a width */
/* WARNING: applying a background here may cause problems with scrolling in WinIE 5.x */
div.tableContainer {
clear: both;
border: 0px;
height: 440px;
width: 750px;
overflow: auto;
}
/* WinIE 6.x needs to re-account for it's scrollbar. Give it some padding */
\html div.tableContainer/* */ {
padding: 0 16px 0 0;
width: 750px;
}
/* clean up for allowing display Opera 5.x/6.x and MacIE 5.x */
html>body div.tableContainer {
height: auto;
padding: 0;
}
/* Reset overflow value to hidden for all non-IE browsers. */
/* Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body div[class].tableContainer {
height: 440px;
overflow: hidden;
width: 750px
}
/* define width of table. IE browsers only */
/* if width is set to 100%, you can remove the width */
/* property from div.tableContainer and have the div scale */
div.tableContainer table {
float: left;
width: 100%
}
/* WinIE 6.x needs to re-account for padding. Give it a negative margin */
\html div.tableContainer table/* */ {
margin: 0 -16px 0 0
}
/* define width of table. Opera 5.x/6.x and MacIE 5.x */
html>body div.tableContainer table {
float: none;
margin: 0;
width: 100%
}
/* define width of table. Add 16px to width for scrollbar. */
/* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body div[class].tableContainer table {
width: 100%
}
/* define the table content to be scrollable */
/* set TBODY element to have block level attributes. All other non-IE browsers */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
/* induced side effect is that child TDs no longer accept width: auto */
/* Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body tbody[class].scrollContent {
display: block;
height: 440px;
overflow: auto;
width: 750px;
}
/* make TD elements pretty. Provide alternating classes for striping the table */
/* http://www.alistapart.com/articles/zebratables/ */
tbody.scrollContent td, tbody.scrollContent tr.normalRow td {
background: #FFF;
border-bottom: none;
border-left: none;
border-right: 0px;
border-top: 0px;
padding: 5px 5px 5px 5px
}
tbody.scrollContent tr.alternateRow td {
background: #FFF;
border-bottom: none;
border-left: none;
border-right: 0px;
border-top: 0px;
padding: 5px 5px 5px 5px
}
/* define width of TD elements: 1st, 2nd, and 3rd respectively. */
/* All other non-IE browsers. */
/* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */
html>body tbody.scrollContent td {
width: 33%
}
html>body tbody.scrollContent td + td {
width: 33%
}
html>body tbody.scrollContent td + td + td {
width: 33%
}
What really makes it frustrating is it works in IE if I change the HTML DOC TYPE to just <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> with <html>
rather than:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
but in doing so it screws up other css code in IE?????? WHY wont it work with the above doctype?
html ---->
<div class="tableContainer" id="tableContainer">
<table border="0" cellpadding="0" cellspacing="0" width="755" class="scrollTable">
<tbody class="scrollContent">
<tr>
<td>
<br/>
SCROLLABLE PAGE CONTENT
</td>
</tr>
</tbody>
</table>
</div>
css ---->
/* define height and width of scrollable area. Add 16px to width for scrollbar */
/* allow WinIE to scale 100% width of browser by not defining a width */
/* WARNING: applying a background here may cause problems with scrolling in WinIE 5.x */
div.tableContainer {
clear: both;
border: 0px;
height: 440px;
width: 750px;
overflow: auto;
}
/* WinIE 6.x needs to re-account for it's scrollbar. Give it some padding */
\html div.tableContainer/* */ {
padding: 0 16px 0 0;
width: 750px;
}
/* clean up for allowing display Opera 5.x/6.x and MacIE 5.x */
html>body div.tableContainer {
height: auto;
padding: 0;
}
/* Reset overflow value to hidden for all non-IE browsers. */
/* Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body div[class].tableContainer {
height: 440px;
overflow: hidden;
width: 750px
}
/* define width of table. IE browsers only */
/* if width is set to 100%, you can remove the width */
/* property from div.tableContainer and have the div scale */
div.tableContainer table {
float: left;
width: 100%
}
/* WinIE 6.x needs to re-account for padding. Give it a negative margin */
\html div.tableContainer table/* */ {
margin: 0 -16px 0 0
}
/* define width of table. Opera 5.x/6.x and MacIE 5.x */
html>body div.tableContainer table {
float: none;
margin: 0;
width: 100%
}
/* define width of table. Add 16px to width for scrollbar. */
/* All other non-IE browsers. Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body div[class].tableContainer table {
width: 100%
}
/* define the table content to be scrollable */
/* set TBODY element to have block level attributes. All other non-IE browsers */
/* this enables overflow to work on TBODY element. All other non-IE, non-Mozilla browsers */
/* induced side effect is that child TDs no longer accept width: auto */
/* Filter out Opera 5.x/6.x and MacIE 5.x */
head:first-child+body tbody[class].scrollContent {
display: block;
height: 440px;
overflow: auto;
width: 750px;
}
/* make TD elements pretty. Provide alternating classes for striping the table */
/* http://www.alistapart.com/articles/zebratables/ */
tbody.scrollContent td, tbody.scrollContent tr.normalRow td {
background: #FFF;
border-bottom: none;
border-left: none;
border-right: 0px;
border-top: 0px;
padding: 5px 5px 5px 5px
}
tbody.scrollContent tr.alternateRow td {
background: #FFF;
border-bottom: none;
border-left: none;
border-right: 0px;
border-top: 0px;
padding: 5px 5px 5px 5px
}
/* define width of TD elements: 1st, 2nd, and 3rd respectively. */
/* All other non-IE browsers. */
/* http://www.w3.org/TR/REC-CSS2/selector.html#adjacent-selectors */
html>body tbody.scrollContent td {
width: 33%
}
html>body tbody.scrollContent td + td {
width: 33%
}
html>body tbody.scrollContent td + td + td {
width: 33%
}
What really makes it frustrating is it works in IE if I change the HTML DOC TYPE to just <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> with <html>
rather than:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
but in doing so it screws up other css code in IE?????? WHY wont it work with the above doctype?