Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Layout w/tables and CSS. Problem in IE
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedLayout w/tables and CSS. Problem in IE

 Post Reply Post Reply
Author
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Direct Link To This Post Topic: Layout w/tables and CSS. Problem in IE
    Posted: 02 July 2004 at 11:22am
Yo..
I'vo got this problem with using CSS in this crappy CSS support less browser called Internet Explorer..
In Mozilla Firefox (and probably other versions and hopefully Opera) it shows EXACTLY like it should.. but in IE, which has this poor CSS Support, it looks terrible!
I have come to the solution with having an extra stylesheet for IE that corrects everything, but I can't figure out what to put in it

The HTML I use is like this:
<script language="javascript" src="<% = strRoot %>includes/default_javascript.js" type="text/javascript"></script>

<meta name="Copyright" content="Copyright (c) Simen Arntsen 2004">
<link href="<% = strSkinPath %>style.css" rel="stylesheet" type="text/css" /><%
If InStr(1, BrowserType(), "IE", 1) > 0 Then Response.Write("<link href=""" & strSkinPath & "ie_x_style.css"" rel=""stylesheet"" type=""text/css"" />") %>
</head>
<body>
<table id="page">
   <tr>
    <td>
     <table id="header">
      <tr>
       <td>
<!-- #include file="header_inc.asp" -->
       </td>
      </tr>
     </table>
    </td>
   </tr><%
   If blnNavigationBar = True Then %>
   <tr>
    <td>
     <table id="navigation">
      <tr>
       <td>
<!-- #include file="navigation_inc.asp" -->
       </td>
      </tr>
     </table>
    </td>
   </tr><%
   End If %>
   <tr>
    <td>
     <table id="middle" cellpadding="0" cellspacing="0">
      <tr><%
       If blnLeftColumn = True Then %>
       <td width="<% = strLeftColumnWidth %>" height="100%">
        <table id="left">
        <tr>
           <td valign="top">
<!-- #include file="left_inc.asp" -->
           </td>
        </tr>
        </table>
       </td><%
       End If %>
       <td width="<% = strContentColumnWidth %>" valign="top">
        <table id="content">
        <tr>
           <td>
           <!-- [===========================================================================] -->
           <!-- [============================ Start Page Content ===========================] -->
           <!-- [===========================================================================] --><%
            Call FormatTop("", "Innhold", "Her skal innholdet vere") %>
            <p>Dette er innholdet</p><%
            Call FormatBottom() %>
           <!-- [===========================================================================] -->
           <!-- [============================= End Page Content ============================] -->
           <!-- [===========================================================================] -->
           </td>
        </tr>
        </table>
       </td><%
       If blnRightColumn = True Then %>
       <td width="<% = strRightColumnWidth %>" height="100%">
        <table id="right">
        <tr>
           <td valign="top">
<!-- #include file="right_inc.asp" -->
           </td>
        </tr>
        </table>
       </td><%
       End If %>
      </tr>
     </table>
    </td>
   </tr>
   <tr>
    <td>
     <table id="footer">
      <tr>
       <td>
<!-- #include file="footer_inc.asp" -->
       </td>
      </tr>
     </table>
    </td>
   </tr>
</table>


the CSS looks like this
[CODE]BODY
{
font-family: Tahoma, 'Trebuchet MS' , Arial, Verdana;
font-size: 12px;
margin: 10px;
}
#page
{
border: solid 1px black;
padding: 10px;
width: 100%;
}
#header
{
border: #000000 1px solid;
background-color: #f1f1f1;
width: 100%;
margin: 0px 0px 5px 0px;
}
#headercontent
{
width: 100%;
}
#navigation
{
border: #000000 1px solid;
background-color: #f1f1f1;
width: 100%;
}
#middle
{
margin: 5px 0px 5px 0px;
width: 100%;
height: 100%;
}
#left
{
border: #000000 1px solid;
background-color: #f1f1f1;
vertical-align: top;
height: 100%;
width: 100%;
padding: 5px;
}
#content
{
margin: 0px 10px 0px 10px;
border: #000000 1px solid;
background-color: #f1f1f1;
vertical-align: top;
width: 100%;
padding: 5px;
}
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Direct Link To This Post Posted: 02 July 2004 at 1:00pm

In # middle, add a 

clear:both;


Lead me not into temptation... I know the short cut, follow me.
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Direct Link To This Post Posted: 02 July 2004 at 1:06pm
hmmm.. didn't notice any difference
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Direct Link To This Post Posted: 02 July 2004 at 1:12pm
I know the problem occurs when using width: 100% together with padding and margins, but how do I avoid it?
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Direct Link To This Post Posted: 02 July 2004 at 1:18pm
I have updated CSS in #page, #header, #navigation, #middle and #footer..

#page

{
border: solid 1px black;
padding: 5px;
width: 100%;
}
#header
{
border: #000000 1px solid;
background-color: #f1f1f1;
width: 100%;
margin: 5px 5px 5px 5px;
}
#navigation
{
border: #000000 1px solid;
background-color: #f1f1f1;
width: 100%;
margin: 0px 5px 0px 5px;
}
#middle
{
margin: 5px 5px 5px 5px;
width: 100%;
height: 100%;
}
#footer
{
border: #000000 1px solid;
background-color: #f1f1f1;
width: 100%;
margin: 0px 5px 5px 5px;
}


the firefox version looks the same, but the IE version now looks like this

all I need is now to get space after the right side of the boxes
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Direct Link To This Post Posted: 02 July 2004 at 1:47pm
This is actually easier with div's than with tables because you don't have to deal with browser glitches with table handling as well a css handling. Perhaps try cell padding ? or wrap the contents of the center td in a div, apply the border style to the dive, and use padding on the td instead of a margin.

Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Direct Link To This Post Posted: 02 July 2004 at 6:20pm
If you can show me how to do it with Divs, that's no problem, but to be honest, I have no idea how to do it.. I have tried several things, but everything fails..

but I will try what you added after posting tomorrow..


thank you
Back to Top
Shimpi06 View Drop Down
Groupie
Groupie


Joined: 30 December 2003
Location: United States
Status: Offline
Points: 70
Direct Link To This Post Posted: 03 July 2004 at 5:23pm

I believe there is a bug in IE that misimpliments CSS box models as prescribed by the W3C.

This website explains 3 work arounds to fix that problem.

http://glish.com/css/hacks.asp

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.