...

View Full Version : Issue with CSS in IE



tgopalakrishnan
09-20-2006, 03:10 PM
Hi
I am trying to display the table size as the size of the screen.
That is if the table has four rows then the four rows height should be automatically adjusted to occupy the size of the screen. Below sample perfectly works in Firefox but it is not working in IE.

Please pass your suggesstions to overcome this problem

If i remove the doctype it is working fine, but i want the DTD need to be included in my HTML page.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">

<html>
<head>
<title>Sample</title>
<style type="text/css">
.tablestyle{
position:relative;
height:100%;
width:100%;
}
</style>
</head>
<body>

<table border="1" id="abc" class="tablestyle">
<tr><td>Hai1</td></tr>
<tr><td>Hai2</td></tr>
<tr><td>Hai3</td></tr>
<tr><td>Hai4</td></tr>
<tr><td>Hai5</td></tr>
</table>
</body>
</html>

percepts
09-20-2006, 03:43 PM
use this doc type instead.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

the above will force IE into quirks mode which solves the problem.

or if you really want to keep your original dtd just put the following comment above the dtd

<!-- run in quirks mode -->

as you can see from the comment, what it does is to force the browser (IE) to quirks mode which renders the doctype pointless in IE

tgopalakrishnan
09-20-2006, 04:34 PM
Since the doctype is generated by our framework, we can't remove or modify it. Is it possible to fix this issue with out altering the doctype

percepts
09-20-2006, 04:42 PM
yes use the second option I gave you which is to put a comment above the dtd.

harbingerOTV
09-20-2006, 05:15 PM
html, body {
height: 100%;
}


add that to your css and see if works.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum