Jump to content

Row height in IE differes when using quirks mode and standard compliance mode


Chabernac

Recommended Posts

Hi,I'm trying to write layout managers for a J2EE application. One of the things I'd like to do is to be able to place an element in a large empty cell on a specific location, for example the top right corner. I've tried to do this with css but it's too difficult, I'm using plain old tables now. This works fine in firefox in both standard compliance mode and quirks mode but in IE it only works in quirks mode and I want my pages to render in standard compliance mode. The code below just places a string 'content' in the top right corner, a doctype is defined so it's running in standard compliance mode and only works correct in firefox. I'd appreciate ideas for making it work in IE.Thanks!Guy.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head>	<style type="text/css">	html, body{		width: 90%;		height: 90%;	}</style></head><body><!--Create a table which fill's up all available space--><table style='height:100%;width:100%' border='1'>				<!-- Create a row of 1px height and place content in second cell of 1px width						 the cell will resize to content placed inside -->				<tr style='height:1px;width:auto'><td ></td><td style='width:1px'>content</td></tr>				<!-- Create a bottom row which consumes all the space left in the table -->				<tr style='height:auto;'><td colspan='2' style='width:auto'></td></tr></table></body></html>

Link to comment
Share on other sites

Hmmm, not really sure what you are trying to achive here.If its what i think you want try this http://www.glish.com/css/7.aspThat will get your layout sorted and then you can tweak accordingly.If its the table route you want to take then try

<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head><body><table width="100%" border="1" cellspacing="0" cellpadding="0">  <tr>	<td> </td>	<td><table width="50%" border="1" align="right" cellpadding="0" cellspacing="0">	  <tr>		<td> </td>	  </tr>	</table></td>  </tr>  <tr>	<td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">	  <tr>		<td> </td>	  </tr>	</table></td>  </tr></table></body></html>

If this is not what you are after then i will require more info

Link to comment
Share on other sites

I've uploaded 2 pages to clarify the problemhttp://users.skynet.be/bk292151/scm.htmlhttp://users.skynet.be/bk292151/quirks.htmlThe first page starts with the line

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

this causes the page to render in standard compliance mode. The intention is to place the tekst 'content' in the top right corner. When you open the first URL in IE the tekst does not show up in the top right corner but at the right in the middle. When you click the second URL in IE it works fine, this page renders in quirks mode.I just want to have the same result with standard compliance mode as in quirks mode.The intention is to build layout managers for a web application, so that you can build a layout like you do in java with layout managers. for example you could have something like this in a JSP:

<fi:Panel layoutManager="<%=new GridLayout(1,1)%>">		<fi:AddComponent constraint="<%=GridLayout.TOPLEFT%>">			content		</fi:AddComponent></fi:Panel>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...