View Full Version : css, IE, and tables


staffa
02-21-2005, 03:15 PM
I am building a very simple website, and yet, I have problems when using Internet Explorer.

in my css file, I have following entry:

.....
div#midframe{
margin-left : 20%;
margin-right : 20%;
}

in my html file, I have :

....
<div id="midframe">
<table>
<tr>
<td width=50%> .... </td>
<td width=50%> .... </td>
</tr>
</table>
</div>
....

this works all very good when viewing with firefox .... but IE just makes a mess out of it. My page gets extra wide, the margins are not correct .... just one big mess ... Is this normal behaviour for IE, and is there a way to fix it ?

Edit: sorry, wrong forum ... should be in css ... sorry

randomjon
02-21-2005, 04:40 PM
Whats the website i want to see for myself before i might be able to fix the problem.

Dutch.American
02-21-2005, 04:54 PM
Here, I cleaned it up for you. When I looked at through the browsers it looked fine.

I hope this is what you where looking for.

CSS:
#midframe{
margin-left : 20;
margin-right : 20;
}


HTML:
<html>
<head>
<title>Your page title goes here</title>
<LINK href="mystylesheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="midframe">
<table border="0">
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
</div>
</body>
</html>

Hope this Helps,
Dutch

staffa
02-22-2005, 08:11 AM
@randomjon : I am waiting for webspace, I can only test it on my own PC, this should be sloved by the end of this week.

@Dutch.American : this is not realy what I want. I want to have a margin left and right of 20%. The remaining space on the page must be the split in twice 50%. As the 20% is specified in css, I assume I can put

<td width=50%> Cell1 </td>
<td width=50%> Cell2 </td>

I have tried the same thing but with 30%, but IE still has problems. IE realy has problems with the % stuff I guess.